Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent change results in build failure babel/polyfill 7.4.3 #9819

Closed
infolock opened this Issue Apr 3, 2019 · 9 comments

Comments

Projects
None yet
6 participants
@infolock
Copy link

commented Apr 3, 2019

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

@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Apr 3, 2019

Hey @infolock! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

@infolock

This comment has been minimized.

Copy link
Author

commented Apr 3, 2019

one can also get this to build without any code changes by using by passing in devtools: 'eval' to webpack and it passes without issue. however - this is obviously not ideal..

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

This will be fixed by #9812, but I tought that it was only an internal problem 🤔

@infolock

This comment has been minimized.

Copy link
Author

commented Apr 3, 2019

Thanks! Yea, I dunno. we can revert to 7.2.5 and it seems to be working fine there too..

@nicolo-ribaudo nicolo-ribaudo added this to the v7.4.4 milestone Apr 3, 2019

@danez danez removed the i: needs triage label Apr 3, 2019

@infolock

This comment has been minimized.

Copy link
Author

commented Apr 3, 2019

fwiw, 7.4.0 builds fine as well

@justinyueh

This comment has been minimized.

Copy link

commented Apr 8, 2019

I use idempotent-babel-polyfill to prevent polyfill multiple times, and i can't revert 7.4.0.
when release the new version?

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member

commented Apr 8, 2019

@justinyueh You could use @babel/polyfill v7.4.0 and import @babel/polyfill/noConflict which doesn't warn when loaded multiple times.

@artemave

This comment has been minimized.

Copy link

commented Apr 10, 2019

What is the ETA on the fix being released?

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member

commented Apr 15, 2019

Merged: #9812

dr-js added a commit to dr-js/dr-dev that referenced this issue Apr 24, 2019

dr-dev@0.0.5-dev.3
notable change:
- break: upgrade babel env target to node 10
- use `dr-js@0.21.0-dev.4`
- add bin option `test-timeout`
- add test global func `info` for test log padding
- todo: lock `@babel/preset-env` to `^7.4.4 || 7.4.2`, check: babel/babel#9819
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.