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

Build fails in rollup@3.8.0 when using resolve() and preserveModules #4765

Closed
eKoopmans opened this issue Dec 22, 2022 · 1 comment · Fixed by #4766
Closed

Build fails in rollup@3.8.0 when using resolve() and preserveModules #4765

eKoopmans opened this issue Dec 22, 2022 · 1 comment · Fixed by #4766

Comments

@eKoopmans
Copy link

Rollup Version

3.8.0

Operating System (or Browser)

Windows

Node Version (if applicable)

v16.15.1

Link To Reproduction

https://stackblitz.com/edit/rollup-repro-jkdrca?file=package.json

Expected Behaviour

Successful build (v3.7.5 builds successfully).

This defect is specifically when trying to build with the combination of:

  1. preserveModules: true in the output config
  2. The resolve() plugin
  3. Specific dependencies - I have only reproduced it with lit, and can confirm that other dependencies (e.g. uuid) do not reproduce the defect on their own

Actual Behaviour

Build fails because chunkDep is undefined:

index.js → build...
[!] TypeError: Cannot destructure property 'imports' of 'chunkDep' as it is undefined.
    at Chunk.getChunkExportDeclarations (C:\D2L\test\2022-12-22-rollup-bug\node_modules\rollup\dist\shared\rollup.js:15788:33)
    at Chunk.render (C:\D2L\test\2022-12-22-rollup-bug\node_modules\rollup\dist\shared\rollup.js:15635:67)
    at C:\D2L\test\2022-12-22-rollup-bug\node_modules\rollup\dist\shared\rollup.js:16889:72
    at Array.map (<anonymous>)
    at renderChunks (C:\D2L\test\2022-12-22-rollup-bug\node_modules\rollup\dist\shared\rollup.js:16889:53)
    at Bundle.generate (C:\D2L\test\2022-12-22-rollup-bug\node_modules\rollup\dist\shared\rollup.js:17102:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C:\D2L\test\2022-12-22-rollup-bug\node_modules\rollup\dist\shared\rollup.js:25229:27
    at async catchUnfinishedHookActions (C:\D2L\test\2022-12-22-rollup-bug\node_modules\rollup\dist\shared\rollup.js:24367:20)
    at async Promise.all (index 0)
@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4766 as part of rollup@3.8.1. You can test it via npm install rollup.

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

Successfully merging a pull request may close this issue.

2 participants