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

manualChunks option fails with unexpected error if the chunk only contains dynamic imports #2353

Closed
taylorcode opened this issue Jul 25, 2018 · 1 comment

Comments

@taylorcode
Copy link

taylorcode commented Jul 25, 2018

Hello from Dropbox!

The manualChunks option produces an unexpected error TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined if the chunk group only contains dynamic imports:

manualChunks: {
  dynamic_imports: [
    'src/dynamic_used_by_a.js',
    'src/dynamic_used_by_both.js',
  ],
},

Repro here:
https://github.com/taylorcode/rollup-manualchunks-dynamic-import-issue

@guybedford
Copy link
Contributor

Thanks for posting the replication here. Turns out this is to do with the dynamic import chunk being empty - if you add any non-treeshakable content it will work in the dynamic module in the example (eg just a console.log statement).

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

No branches or pull requests

3 participants