nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.56k stars 2.36k forks source link

After Upgrade to 17.2.0 from 17.1.3 I receive the error Can't resolve 'core-js/modules/es.array.to-reversed.js' #28679

Open wcwcaseman opened 4 days ago

wcwcaseman commented 4 days ago

Current Behavior

I upgraded from NX 17.1.3 to 17.2.0. I have a polyfill.ts as an option for pollyfills in my project.json. It import 'core-js'; . After the NX upgrade I am now receiving many errors for core-js Can't resolve 'core-js/modules/es.array.to-reversed.js', Can't resolve 'core-js/modules/es.array.to-sorted.js' etc.

Expected Behavior

I expect to not receive errors for core-js import in pollyfills.ts

GitHub Repo

No response

Steps to Reproduce

  1. Create NX 17.2.0 or above project.
  2. Add a pollyfills.ts and reference it in project.json
  3. in pollyfills.ts import 'core-js'
  4. run the project.

Nx Report

Node : 20.17.0 OS : darwin-x64 pnpm : 9.10.0

nx : 17.2.0 @nx/js : 17.2.0 @nx/jest : 17.2.0 @nx/linter : 17.2.0 @nx/eslint : 17.2.0 @nx/workspace : 17.2.0 @nx/cypress : 17.2.0 @nx/devkit : 17.2.0 @nx/eslint-plugin : 17.2.0 @nx/plugin : 17.2.0 @nx/react : 17.2.0 @nx/storybook : 17.2.0 @nrwl/tao : 17.2.0 @nx/web : 17.2.0 @nx/webpack : 17.2.0 typescript : 5.2.2

Community plugins: ts-check : 1.0.0

Local workspace plugins: @ecp/workspace-plugin

Failure Logs

ERROR in ../../../tools/webpack/polyfills.ts 25:0-49 Module not found: Error: Can't resolve 'core-js/modules/es.array.to-reversed.js' ERROR in ../../../tools/webpack/polyfills.ts 26:0-47 Module not found: Error: Can't resolve 'core-js/modules/es.array.to-sorted.js ERROR in ../../../tools/webpack/polyfills.ts 27:0-48 Module not found: Error: Can't resolve 'core-js/modules/es.array.to-spliced.js'

Package Manager Version

No response

Operating System

Additional Information

I also tried to upgrade to 17.2.8 and i'm still seeing this issue.

wcwcaseman commented 4 days ago

My core-js version was too old "core-js": "3.23.5",. Upgraded to "core-js": "3.35.1" and the errors went away. Not sure of the connection in the upgrade to NX. NX 17.2.X should bump core-js version as it looks like that is required.