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. Error: UMD and IIFE output formats are not supported for code-splitting builds.

See original GitHub issue

I’m getting this when I build:

[!] Error: UMD and IIFE output formats are not supported for code-splitting builds.
Error: UMD and IIFE output formats are not supported for code-splitting builds.
yarn run v1.21.1
warning package.json: No license field
$ run-s build start
warning package.json: No license field
$ rollup -c

src/main.js → public/build/bundle.js...
(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en/#error-this-is-undefined
node_modules/intl-messageformat/lib/core.js
4: See the accompanying LICENSE file for terms.
5: */
6: var __assign = (this && this.__assign) || function () {
                   ^
7:     __assign = Object.assign || function(t) {
8:         for (var s, i = 1, n = arguments.length; i < n; i++) {
...and 1 other occurrence
node_modules/intl-messageformat/lib/formatters.js
1: var __extends = (this && this.__extends) || (function () {
                    ^
2:     var extendStatics = function (d, b) {
3:         extendStatics = Object.setPrototypeOf ||
...and 3 other occurrences
node_modules/intl-format-cache/lib/index.js
4: See the accompanying LICENSE file for terms.
5: */
6: var __spreadArrays = (this && this.__spreadArrays) || function () {
                         ^
7:     for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
8:     for (var r = Array(s), k = 0, i = 0; i < il; i++)
...and 1 other occurrence

...and 3 other files```

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
timohausmanncommented, Nov 25, 2020

I’m also getting this error following instructions from the docs:

register('en', () => import('./en.json'));

I found these solutions:

  • fallback to addMessages instead of register
  • add output: { inlineDynamicImports : true } to your rollup.config.js
  • put i18n-files in /public and code your own funny little Promise loader like:
register('en', function() {
    return window.fetch('/i18n/en.json')
        .then(data => data.json())
        .catch(error => console.log('i18n fetch error', error))
});

I don’t wanna be a nagging b*tch but in my opinion this is a valid issue with this package (or rather it docs) if it doesn’t provide an easy out-of-the-box solution that works with the very default Svelte+Rollup installation but requires a deep understanding of Rollup configs. If you let me know what’s your go-to solution for dynamic imports with Svelte+Rollup I’ll happily provide a PR for the docs.

0reactions
kaisermanncommented, Feb 4, 2021

@timohausmann You’re totally right! I should make it clearer the scenario where one can use dynamic imports or not. The lib was made with mostly Sapper in mind, which has built-in support for dynamic imports. A PR would be great! We could add a section in the FAQ and some note in the getting started document.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: UMD and IIFE output formats are not supported for code ...
I am following the example in the template provided after creating an app from the official svelte demo and I received the above...
Read more >
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 >
Build Options - Vite
If the build is configured to use a non-HTML custom entry via build. ... the exposed global variable and is required when formats...
Read more >
@carbon/charts-svelte - npm
Please direct all questions regarding support, bug fixes, ... UMD and IIFE output formats are not supported for code-splitting builds.
Read more >
Elegant way to support a ton of languages - v6 - CodeMirror
Error : UMD and IIFE output formats are not supported for code-splitting builds. Error: UMD and IIFE output formats are not supported for ......
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