question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: UMD and IIFE output formats are not supported for code-splitting builds.

See original GitHub issue

I am following the example in the template provided after creating an app from the official svelte demo and I received the above ^ error when I set my rollup configuration file format to iife.

input: 'src/main.js', output: { sourcemap: true, format: 'iife', name: 'app', file: 'public/bundle.js' },

Or is this a rollup issue?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

54reactions
mspanishcommented, Jul 4, 2020

This is odd, I do not get this error using a Svelte template on my Linux machine. My dev builds load fine. Then I switched to my Windows laptop and get this error - nothing has changed. I thought maybe I needed to updated some npm modules or something - and did that, and it doesn’t change anything. Same error.

Update: solved it by adding this to the rollup config:

inlineDynamicImports: true,

17reactions
danangponorogocommented, Oct 25, 2020

@mspanish, Alhamdulillah, thank you very much for the clue, finally the error disappeared. To make it clearer, in the code below I will write the rollup.config.js section again, hopefully it’s easier to understand.

export default { input: ‘src/main.js’, output: { sourcemap: true, format: ‘iife’, name: ‘app’, file: ‘public/build/bundle.js’, inlineDynamicImports: true },

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Rollup complain about code-splitting when I am not ...
Why does Rollup accuse me of code-splitting? [!] Error: UMD and IIFE output formats are not supported for code-splitting builds.
Read more >
rollup.js
Rollup allows you to write your code using the new module system, and will then compile it back down to existing supported formats...
Read more >
Build Options - Vite
Note the build will fail if the code contains features that cannot be safely ... global variable and is required when formats includes...
Read more >
Rollup Dynamic Import | Today-I-Learned
UMD and IIFE output formats are not supported for code -splitting builds. ... 参考方案:rollup-plugin-loadz0r,但是限制是AMD 模块。 Today-I-Learned is maintained ...
Read more >
UMD and IIFE output formats are not supported for code ...
Invalid value "umd" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.问题修复 · 问题 · 原因 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found