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

Cypress Component Testing: "Module parse failed: parser.destructuringAssignmentPropertiesFor is not a function" #16803

Closed
1 of 4 tasks
Nick-Lucas opened this issue May 5, 2023 · 9 comments · Fixed by #17707
Assignees
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug

Comments

@Nick-Lucas
Copy link

Current Behavior

After upgrading from 15.x to 16.1.0 component testing does not run

Expected Behavior

Component testing works as before

GitHub Repo

No response

Steps to Reproduce

Upgrade an existing project with component testing, and according to the error have a file like this:

./src/environments/index.ts:

export * from './environment'
export * from './environment.types'
export const isE2E = process.env['NX_E2E'] && process.env['NX_E2E'].length > 0

Nx Report

Node   : 18.14.2
   OS     : linux x64
   pnpm   : 8.4.0
   Hasher : Native
   
   nx                 : 16.1.0
   @nx/js             : 16.1.0
   @nx/jest           : 16.1.0
   @nx/linter         : 16.1.0
   @nx/workspace      : 16.1.0
   @nx/cypress        : 16.1.0
   @nx/devkit         : 16.1.0
   @nx/eslint-plugin  : 16.1.0
   @nx/nest           : 16.1.0
   @nx/node           : 16.1.0
   @nx/plugin         : 16.1.0
   @nx/react          : 16.1.0
   @nrwl/tao          : 16.1.0
   @nx/web            : 16.1.0
   @nx/webpack        : 16.1.0
   typescript         : 5.0.4

Failure Logs

ERROR in ./src/environments/index.ts
Module parse failed: parser.destructuringAssignmentPropertiesFor is not a function
File was processed with these loaders:
 * ../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/@nx/webpack/src/utils/web-babel-loader.js
You may need an additional loader to handle the result of these loaders.
TypeError: parser.destructuringAssignmentPropertiesFor is not a function
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/DefinePlugin.js:575:16
    at Hook.eval (eval at create (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
    at JavascriptParser.callHooksForInfoWithFallback (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:3022:24)
    at JavascriptParser.callHooksForInfo (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2971:15)
    at JavascriptParser.walkMemberExpressionWithExpressionName (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2866:24)
    at JavascriptParser.walkMemberExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2816:11)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2305:10)
    at JavascriptParser.walkLeftRightExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2483:8)
    at JavascriptParser.walkLogicalExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2496:9)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2299:10)
    at JavascriptParser.walkVariableDeclaration (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2126:33)
    at JavascriptParser.walkStatement (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:1620:10)
    at JavascriptParser.walkExportNamedDeclaration (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2007:9)
    at JavascriptParser.walkStatement (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:1584:10)
    at JavascriptParser.walkStatements (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:1481:9)
    at JavascriptParser.parse (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:3375:9)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:1087:26
    at processResult (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:800:11)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:860:5
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:407:3
    at iterateNormalLoaders (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:233:10)
    at iterateNormalLoaders (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:240:10)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:255:3
    at context.callback (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/babel-loader/lib/index.js:41:71
ERROR in ../../../node_modules/.pnpm/[email protected]/node_modules/cypress/react18/dist/cypress-react.esm-bundler.js
Module parse failed: parser.destructuringAssignmentPropertiesFor is not a function
File was processed with these loaders:
 * ../../../node_modules/.pnpm/[email protected][email protected]/node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
TypeError: parser.destructuringAssignmentPropertiesFor is not a function
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/DefinePlugin.js:575:16
    at Hook.eval (eval at create (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
    at Hook.CALL_DELEGATE [as _call] (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/Hook.js:14:14)
    at JavascriptParser.callHooksForInfoWithFallback (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:3022:24)
    at JavascriptParser.callHooksForInfo (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2971:15)
    at JavascriptParser.walkMemberExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2800:27)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2305:10)
    at JavascriptParser.walkLeftRightExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2484:8)
    at JavascriptParser.walkLogicalExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2496:9)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2299:10)
    at JavascriptParser.walkLeftRightExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2483:8)
    at JavascriptParser.walkLogicalExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2496:9)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2299:10)
    at JavascriptParser.walkLeftRightExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2483:8)
    at JavascriptParser.walkLogicalExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2496:9)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2299:10)
    at JavascriptParser.walkConditionalExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2577:9)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2287:10)
    at JavascriptParser.walkVariableDeclaration (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2126:33)
    at JavascriptParser.walkStatement (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:1620:10)
    at JavascriptParser.walkStatements (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:1481:9)
    at JavascriptParser.parse (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:3375:9)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:1087:26
    at processResult (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:800:11)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:860:5
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:407:3
    at iterateNormalLoaders (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:233:10)
    at iterateNormalLoaders (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:240:10)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:255:3
    at context.callback (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at Object.loader (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/source-map-loader/dist/index.js:29:5)
    at LOADER_EXECUTION (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:132:14)
    at runSyncOrAsync (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:133:4)
    at iterateNormalLoaders (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:251:2)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:224:4
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:834:15
    at Array.eval (eval at create (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
    at runCallbacks (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:27:15)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:200:4
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/graceful-fs/graceful-fs.js:123:16
    at /home/nick/.cache/Cypress/12.11.0/Cypress/resources/app/node_modules/@packages/server/node_modules/graceful-fs/graceful-fs.js:123:16
    at /home/nick/.cache/Cypress/12.11.0/Cypress/resources/app/node_modules/@packages/server/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
ERROR in ../../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/styled-components/dist/styled-components.browser.esm.js
Module parse failed: parser.destructuringAssignmentPropertiesFor is not a function
File was processed with these loaders:
 * ../../../node_modules/.pnpm/[email protected][email protected]/node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
TypeError: parser.destructuringAssignmentPropertiesFor is not a function
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/DefinePlugin.js:575:16
    at Hook.eval (eval at create (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
    at JavascriptParser.callHooksForInfoWithFallback (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:3022:24)
    at JavascriptParser.callHooksForInfo (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2971:15)
    at JavascriptParser.walkMemberExpressionWithExpressionName (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2866:24)
    at JavascriptParser.walkMemberExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2816:11)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2305:10)
    at JavascriptParser.walkLeftRightExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2483:8)
    at JavascriptParser.walkLogicalExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2496:9)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2299:10)
    at JavascriptParser.walkLeftRightExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2484:8)
    at JavascriptParser.walkLogicalExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2496:9)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2299:10)
    at JavascriptParser.walkLeftRightExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2483:8)
    at JavascriptParser.walkLogicalExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2496:9)
    at JavascriptParser.walkExpression (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2299:10)
    at JavascriptParser.walkVariableDeclaration (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:2126:33)
    at JavascriptParser.walkStatement (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:1620:10)
    at JavascriptParser.walkStatements (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:1481:9)
    at JavascriptParser.parse (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/javascript/JavascriptParser.js:3375:9)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:1087:26
    at processResult (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:800:11)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib/NormalModule.js:860:5
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:407:3
    at iterateNormalLoaders (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:233:10)
    at iterateNormalLoaders (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:240:10)
    at /home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:255:3
    at context.callback (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected]/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at Object.loader (/home/nick/dev/application-monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/source-map-loader/dist/index.js:143:3)
ERROR in Conflict: Multiple assets emit different content to the same filename index.html
webpack compiled with 4 errors (6d8cf2a01e2d2491)
No errors found.

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@Nick-Lucas
Copy link
Author

Nick-Lucas commented May 5, 2023

This stackoverflow post suggested that the following could cause the error:

  1. using a custom webpack.config.js (I do modify the Nx webpack config, just to disable the error overlay)
  2. having conflicting webpack versions

Looking at my repo:

  • package.json and ./node_modules/webpack contains webpack set at ^5.75.0
  • ./node_modules/@nx/webpack/package.json is set at ^5.80.0 though
  • ./node_modules/@nx/webpack/node_modules/.bin/webpack is referring to [email protected][email protected]/node_modules/webpack/bin/webpack.js

Upgrading webpack to latest (^5.85.0) in package.json seems to resolve this error. Looks like Nx has let some versions get out of line during migrations

@AgentEnder AgentEnder added the scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx label May 5, 2023
@barbados-clemens barbados-clemens self-assigned this May 5, 2023
@barbados-clemens
Copy link
Contributor

barbados-clemens commented May 5, 2023

@Nick-Lucas thanks for opening the issue.

do you have a repo I can take a look at?
what cypress version are you on?
what framework are you using with component testing? (looks like react?)
can you share the cypress.config.ts and webpack config you're using?

@Nick-Lucas
Copy link
Author

Nick-Lucas commented May 5, 2023

Afraid I haven't had a chance to try and reproduce dry, and now we're getting a new King in Blighty so won't be able to share deeper details until Tuesday.

As above I've resolved the issue by upgrading the package.json webpack version. Nx is using a newer version internally than it upgraded me to during the migration path - this repo started out on Nx 13 or 14 and has been migrated regularly up until today - so I believe the next Nx version just needs a migration added to check that webpack is in-line with @nx/webpack's version. Cypress version is also what Nx prescribed I believe.

Full repro conditions as I understand them:

  • Nx 16.1.0
  • Webpack locked at 5.75.0 on the repo package.json
  • Have a React app with Component-Testing added
  • Add a custom webpack.config.js (just re-export the nx config with no changes) to the React app
  • Have a barrel file against environment.ts or some other file which will get processed by Cypress (I commented the process.env lines and the issue persisted, so it's a slightly phantom error around export * probably)

@madelk
Copy link

madelk commented May 9, 2023

I just had the same issue when going from 16.0.3 to 16.1.3 on my React application. I hope to dig in over the next day or so to isolate the issue, my upgrade only contained package version bumps.

@madelk
Copy link

madelk commented May 9, 2023

I just had to change my "webpack": "^5.76.2", to "webpack": "^5.82.0", and that got me rolling

@rathpc
Copy link
Contributor

rathpc commented Jun 20, 2023

as @madelk stated, I changed the same thing and was able to get past the issue. Mismatching webpack versions caused the issue. npm ls webpack will show you all the versions being requested and this is where I saw my application was trying to use 2 different ones

@barbados-clemens
Copy link
Contributor

Hi all, sorry for getting back late on this. but confirmed that the mixed match webpack versions are the issue.
it doesn't happen in new workspaces as the webpack dep isn't installed by default, so that package wasn't version bumped in the workspace package.json when changed in the @nx/webpack package causing the mismatch.

I'll add a migration the @nx/webpack to bump that version in peoples package.json if it exists which should solve the issue for anyone down the road. also if you're not using webpack outside of @nx/webpack. i.e. not calling webpack directly anywhere. it should be safe to remove the dep from your package.json since it's a dep of @nx/webpack.

@rathpc
Copy link
Contributor

rathpc commented Jun 21, 2023

@barbados-clemens Thanks Caleb, that will definitely help!

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants