Recent change results in build failure babel/polyfill 7.4.3
See original GitHub issueBug Report
Current Behavior
ERROR in bundle.5ecbe226d86cc8df5e59.js from UglifyJs
Unexpected token: keyword «const» [./node_modules/@babel/polyfill/lib/index.js:6,0][bundle.5ecbe226d86cc8df5e59.js:95888,2]
Child extract-css-chunks-webpack-plugin node_modules/css-loader/index.js!node_modules/sass-loader/lib/loader.js??ref--8-2!node_modules/@salesforce-mc/blockstandardcomponents/components/emoji-picker/emoji-picker.scss:
Input Code
Not sure where the code is, but if you navigate to the file its complaining about (node_modules/@babel/polyfill/lib/index.js
) you can see a definition for the global
function
function _global() {
const data = _interopRequireDefault(require("core-js/library/fn/global"));
_global = function () {
return data;
};
return data;
}
Changing const data
to just be var data
results in the build passing again.
Expected behavior/code The build should pass without issue…
Environment
- Babel version(s): 7.4.3
- Node/npm version: Node 8/npm 5.5.1
- OS: OSX
- Monorepo: ehh…?
- How you are using Babel: [e.g.
cli
,register
,loader
]
Possible Solution
Change const
to var
and it works fine…
Additional context/Screenshots
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Webpack 4 + Babel 7.4.0 + Babel Polyfill - Stack Overflow
As of Babel 7.4.0, @babel/polyfill has been deprecated. With Babel 7.4.0 there has been changes to the way polyfilling works.
Read more >Upgrade to Babel 7
Because not every breaking change will affect every project, we've sorted the sections by the likelihood of a change breaking tests when upgrading....
Read more >babel/polyfill
Babel includes a polyfill that includes a custom regenerator runtime and core-js. This will emulate a full ES2015+ environment (no < Stage 4...
Read more >babel/preset-env
babel /preset-env` is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, ......
Read more >7.4.0 Released: core-js 3, static private methods and partial ...
Special thanks to all the new Babel contributors . ... He maintains core-js which provides all the polyfills loaded by @babel/polyfill ...
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 Free
Top 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
fwiw,
7.4.0
builds fine as wellWhat is the ETA on the fix being released?