-
Notifications
You must be signed in to change notification settings - Fork 273
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
Issue on XMAKE, Error: UMD and IIFE output formats are not supported for code-splitting builds. #1946
Comments
Hello @codefactor , We haven't changed anything that might affect rollup. The 0.21.8 release consisted of just standard bugfixes, not directly related to the build. Could it be that you've recently changed your custom rollup configuration (I noticed you had such in Regards, |
Nothing changes if we revert the changes to the rollup.config.js to the original non-customized version which looks like this:
It really looks like some issue that was introduced in the version change to 0.21.8 - perhaps a small version change in the tools as to what version of rollup is used or something like that. |
Hi @codefactor , I cannot reproduce the issue on my localhost out of the box. I however debugged rollup's source code and the condition to throw this error lies here: chunks = yield graph.build(inputOptions.input, inputOptions.manualChunks, inputOptions.inlineDynamicImports); and then based on if (hasMultipleChunks) {
if (outputOptions.format === 'umd' || outputOptions.format === 'iife')
return error({
code: 'INVALID_OPTION',
message: 'UMD and IIFE output formats are not supported for code-splitting builds.'
}); There are obviously 3 ways to get there:
Regarding rollup versions. UI5 Web Components was with 1.23 and
Could you add a Regards, |
Hi @vladitasev, I found that one of our dependencies, "@xweb/core-utils", was using dynamic imports via the babel plugin "@babel/plugin-proposal-dynamic-import". Current solution is to add the following to the rollup.config.js : const ES5_CONFIG = rollup.find((config) => /es5\.js$/.test(config.input));
if (ES5_CONFIG) {
ES5_CONFIG.inlineDynamicImports = true;
} After adding the above lines, we are able to get a successful build. Thanks, |
Hello @codefactor @allen138 I've debugged quite a bit today and discovered that the error disappears once you remove imports of: For example, a bundle that just imports Stripping down its imports one by one, I found that the error appears when this import is added: I'll investigate further tomorrow, but this might give you some clue in the meantime Regards |
I would suggest that you use the following config: rollup = [
{
...rollup[0],
input: "bundle.mock.js"
},
rollup[0],
{
...rollup[1],
inlineDynamicImports: true
}
] which basically enforces |
Thanks for tracking down the particular import that introduces the need for code splitting. The import for |
Describe the bug
I tried upgrading to 0.21.8 and there is an issue in XMAKE which is not happening on my local. I sometimes see this same error on local but only when I accidentally run a build at the same time as the "npm run start" is running and building at the same time.
Log output / Any errors in the console
Check the following logs, let me know if you need a link to XMAKE.
The text was updated successfully, but these errors were encountered: