Skip to content

Fix Module not found: Error: Can't resolve 'core-js/modules/es6.array.concat.js' with compat-data@7.13.x#12901

Merged
nicolo-ribaudo merged 6 commits intobabel:mainfrom
luxp:fix-babel-compat-data-corejs2
Feb 25, 2021
Merged

Fix Module not found: Error: Can't resolve 'core-js/modules/es6.array.concat.js' with compat-data@7.13.x#12901
nicolo-ribaudo merged 6 commits intobabel:mainfrom
luxp:fix-babel-compat-data-corejs2

Conversation

@luxp
Copy link
Copy Markdown
Contributor

@luxp luxp commented Feb 25, 2021

Q                       A
Patch: Bug Fix? Bugfix
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Any Dependency Changes? No
License MIT

After upgrade the @babel/compat-data@7.13 encounted the problem below.

image

.babelrc

[
      '@babel/preset-env',
      {
        'targets': targets || {
          'android': '4',
          'ios': '9',
        },
        'useBuiltIns': 'entry',
        'corejs': 2,
        'modules': false,
      },
]

Usage in code

import '@babel/polyfill'

Related this pull request: https://github.com/babel/babel/pull/12850/files#r582504324

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Feb 25, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/42769/

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Feb 25, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ecf1057:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@nicolo-ribaudo
Copy link
Copy Markdown
Member

I'm sorry 🤦 I missed this because the comment explaining why these were not included gave the wrong reason.

Can you delete them from packages/babel-compat-data/scripts/data/corejs2-built-in-features.js?

@nicolo-ribaudo
Copy link
Copy Markdown
Member

nicolo-ribaudo commented Feb 25, 2021

NOTE: The CI / Test @babel/runtime integrations failure is unrelated (it's also failing on main).

Could you run OVERWRITE=true make test to update the fixtures? I don't think there will be any change, since those fixtures are generated by babel-plugin-polyfill-corejs2 which pulls the @babel/compat-data dependency from npm and not from the monorepo.

@nicolo-ribaudo
Copy link
Copy Markdown
Member

Actually, adding this to resolutions in the top-level package.json would probably make the tests correctly reflect @babel/compat-data:

"babel-plugin-polyfill-corejs2/@babel/compat-data": "workspace:*"

@nicolo-ribaudo nicolo-ribaudo added i: regression pkg: compat-data pkg: preset-env PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Feb 25, 2021
@luxp
Copy link
Copy Markdown
Contributor Author

luxp commented Feb 25, 2021

Actually, adding this to resolutions in the top-level package.json would probably make the tests correctly reflect @babel/compat-data:

"babel-plugin-polyfill-corejs2/@babel/compat-data": "workspace:*"

I'm trying

@nicolo-ribaudo
Copy link
Copy Markdown
Member

You need to run yarn to update the lockfile 🙏

@luxp
Copy link
Copy Markdown
Contributor Author

luxp commented Feb 25, 2021

This seems has been fixed. And tests are all passed on my local machine.

Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This was referenced Mar 8, 2021
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 28, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: compat-data pkg: preset-env PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants