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

Lock @babel/preset-env version to avoid breakage #8881

Closed
wants to merge 1 commit into from

Conversation

markhoney
Copy link

@babel/preset-env has removed utils.js in version 7.13.0, which is required by polyfills-plugin.js (https://github.com/nuxt/nuxt.js/blob/dev/packages/babel-preset-app/src/polyfills-plugin.js). This fix locks the dependency to 7.12.x.

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

@babel/preset-env has removed utils.js in version 7.13.0, which is required by polyfills-plugin.js (https://github.com/nuxt/nuxt.js/blob/dev/packages/babel-preset-app/src/polyfills-plugin.js). This fix locks the dependency to 7.12.x.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@babel/preset-env has removed utils.js in version 7.13.0, which is required by polyfills-plugin.js (https://github.com/nuxt/nuxt.js/blob/dev/packages/babel-preset-app/src/polyfills-plugin.js). This fix locks the dependency to 7.12.x.
@markhoney
Copy link
Author

I've reported the issue to the Babel team (babel/babel#12856) and they say that the utils.js file is not part of their public API, so they removed it.

@hzoo
Copy link

hzoo commented Feb 23, 2021

Yeah looks like that was just an internal file

I believe @JLHwung may do a PR to replace that function, it's also just 2 lines that could be substituted https://github.com/babel/babel/blob/d0b6f0fe0f8e1afb095e5fb419ed9ac56d4edee6/packages/babel-preset-env/src/utils.js#L63-L69.

@rallz-dev
Copy link

Are you guys planning on releasing this soon ? I was about to start a project with nuxt, but it's broken out of the box, the way it is now. Also, if this is going to take long, could you please point me to a solution to get started with it ?

@hzoo
Copy link

hzoo commented Feb 23, 2021

@JLHwung has a fix #8883

if are able to, you can force an older version in yarn by setting in your package.json

"resolutions": {
  "**/@babel/core": "7.12.17"
}

@rallz-dev
Copy link

@hzoo will this also work with npm ?

@rallz-dev
Copy link

"resolutions": {
"**/@babel/core": "7.12.17"
}

I tried adding this to my project (I'm using NPM btw) but I'm still getting this problem, isn't there any other workaround while this PR doesn't make it into the newest version of nuxt ?

@hzoo
Copy link

hzoo commented Feb 23, 2021

@rallz-dev ah, I just meant that as an example syntax. The issue is with @babel/preset-env so would modify that version. And that workaround is for yarn only then.

You can probably just do this, specify the version in your deps:

  "dependencies": {
    "core-js": "^3.8.3",
    "nuxt": "^2.14.12",
+   "@babel/preset-env": "~7.12.0"
  },

@rallz-dev
Copy link

thanks! that worked!

@Webdvpv
Copy link

Webdvpv commented Sep 14, 2021

It works for me

"dependencies": {
    "core-js": "^3.15.1",
    "nuxt": "^2.15.7"
  }

@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants