question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recent change results in build failure babel/polyfill 7.4.3

See original GitHub issue

Bug 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

Screen Shot 2019-04-03 at 12 24 40 PM

Screen Shot 2019-04-03 at 12 36 03 PM

Screen Shot 2019-04-03 at 12 38 11 PM

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
infolockcommented, Apr 3, 2019

fwiw, 7.4.0 builds fine as well

2reactions
artemavecommented, Apr 10, 2019

What is the ETA on the fix being released?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found