Does not work with Babel 7 beta
See original GitHub issuebabel-macros
version: 1.2.0babel-preset-env
: 7.0.0-beta.3node
version: 8.6.0npm
(oryarn
) version: 5.3.0
Relevant code or config
Simple index.js
const test = preval`module.exports = 1`;
console.log(test);
.babelrc
{
"presets": [ "env" ],
"plugins": ["babel-macros"]
}
What you did:
Ran yarn babel index.js
.
What happened: Log:
TypeError: Cannot read property 'loose' of undefined (While processing preset: "/Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-preset-env/lib/index.js")
at _default (/Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-plugin-transform-es2015-modules-commonjs/lib/index.js:15:22)
at Function.memoisePluginContainer (/Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:113:13)
at Function.normalisePlugin (/Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:146:32)
at /Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
at Array.map (<anonymous>)
at Function.normalisePlugins (/Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at /Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
at /Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
at Array.map (<anonymous>)
error Command failed with exit code 1.
Problem description:
It seems that babel-macros
does not play well with the latest beta version of Babel 7. A bit of a shame since I’d like to use macros to solve another issue caused by Babel 7 with some older code.
A similar error is triggered when using babel-preset-react
:
TypeError: Cannot read property 'pragma' of undefined (While processing preset: "/Users/nick/Documents/Drawbotics/repos/platform-ff/node_modules/babel-preset-react/lib/index.js")
Suggested solution: None for now
Issue Analytics
- State:
- Created 6 years ago
- Comments:20 (12 by maintainers)
Top Results From Across the Web
Upgrade to Babel 7
This just means Babel itself won't run on older versions of Node. It can still output code that runs on old Node versions....
Read more >Jest with Babel ^7.0.0-beta.51 issue - Stack Overflow
I followed everything you recommended me to make the Babel 7 work with the Jest. I installed the @babel/core and babel-core . Still...
Read more >babel-loader - npm
This package allows transpiling JavaScript files using Babel and webpack. Note: Issues with the output should be reported on the Babel ...
Read more >babel/polyfill (Babel 7 beta) causes a SyntaxError-babel.js
More Query from same tag · React native 0.57 build issues. · Syntax doubling with . · How Babel transpiles the rest/spread operator...
Read more >babel/helper-plugin-utils
Babel 6 and early betas of Babel 7 do not have assertVersion , so this wrapper ensures that it exists and throws a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You may need to install
babel-core@7
. Look at the jest documentation. It explains how to make it work with babel 7.Alrighty,
babel-plugin-macros
has been published and we’re now testing with babel-core @ 7