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

Merge-deep -> Clone-deep packages cause rollup/vite build errors #104

Closed
leifdalan opened this issue Oct 14, 2024 · 0 comments Β· Fixed by #107
Closed

Merge-deep -> Clone-deep packages cause rollup/vite build errors #104

leifdalan opened this issue Oct 14, 2024 · 0 comments Β· Fixed by #107
Assignees

Comments

@leifdalan
Copy link

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

When bundling using rollup, I get the following error:

5.388 βœ“ 2163 modules transformed.
5.390 x Build failed in 4.01s
5.392 node_modules/clone-deep/utils.js (10:0): Illegal reassignment of import "commonjsRequire" in "node_modules/clone-deep/utils.js".
5.392 file: /webapp/node_modules/clone-deep/utils.js:10:0
5.392 
5.392  8: var fn = require;
5.392  9: 
5.392 10: require = utils;
5.392     ^
5.392 11: require('is-plain-object', 'isObject');
5.392 12: require('shallow-clone', 'clone');
5.392 
5.392     at getRollupError (file:///webapp/node_modules/rollup/dist/es/shared/parseAst.js:395:41)
5.392     at error (file:///webapp/node_modules/rollup/dist/es/shared/parseAst.js:391:42)
5.392     at Module.error (file:///webapp/node_modules/rollup/dist/es/shared/node-entry.js:15535:16)
5.392     at Identifier.disallowImportReassignment (file:///webapp/node_modules/rollup/dist/es/shared/node-entry.js:4991:35)
5.392     at Identifier.deoptimizePath (file:///webapp/node_modules/rollup/dist/es/shared/node-entry.js:4888:18)
5.392     at AssignmentExpression.applyDeoptimizations (file:///webapp/node_modules/rollup/dist/es/shared/node-entry.js:10958:19)
5.392     at AssignmentExpression.hasEffects (file:///webapp/node_modules/rollup/dist/es/shared/node-entry.js:10877:18)
5.392     at ExpressionStatement.hasEffects (file:///webapp/node_modules/rollup/dist/es/shared/node-entry.js:2879:28)
5.392     at Program.hasEffects (file:///webapp/node_modules/rollup/dist/es/shared/node-entry.js:13256:22)
5.392     at Program.shouldBeIncluded (file:///webapp/node_modules/rollup/dist/es/shared/node-entry.js:2979:62) {
5.392   code: 'ILLEGAL_REASSIGNMENT',
5.392   id: '/webapp/node_modules/clone-deep/utils.js',
5.392   pos: 425,
5.392   loc: {
5.392     column: 0,
5.392     file: '/webapp/node_modules/clone-deep/utils.js',
5.392     line: 10
5.392   },
5.392   frame: ' 8: var fn = require;\n' +
5.392     ' 9: \n' +
5.392     '10: require = utils;\n' +
5.392     '    ^\n' +
5.392     "11: require('is-plain-object', 'isObject');\n" +
5.392     "12: require('shallow-clone', 'clone');",

This is coming from merge-deep, which seems like an abandoned package. It calls for the first published version of clone-deep, which re-assigns require, and has since been patched.

Two options:

Use

  "overrides": {
    "clone-deep": "^4.0.1"
  },

in package.json or consider replacing the merge-deep dependency.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants