Error: Invalid value "iife" for option "output.format"
Opened this issue · 5 comments
Describe the bug
I tried to import using NPM and got an error. I deleted the p5 packages and installed pnpm.
When I run my svelte app I get the errors below.
[!] Error: Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.
https://rollupjs.org/guide/en/#outputformat
Error: Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.
at error (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/rollup@2.79.1/node_modules/rollup/dist/shared/rollup.js:198:30)
at validateOptionsForMultiChunkOutput (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/rollup@2.79.1/node_modules/rollup/dist/shared/rollup.js:16076:16)
at Bundle.generate (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/rollup@2.79.1/node_modules/rollup/dist/shared/rollup.js:15910:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at /Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/rollup@2.79.1/node_modules/rollup/dist/shared/rollup.js:23833:27
at catchUnfinishedHookActions (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/rollup@2.79.1/node_modules/rollup/dist/shared/rollup.js:23247:20)
at async Promise.all (index 0)
at Task.run (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/rollup@2.79.1/node_modules/rollup/dist/shared/watch.js:246:32)
at Watcher.run (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/rollup@2.79.1/node_modules/rollup/dist/shared/watch.js:173:13)
Same thing here, I'm afraid.
I seem to have the same error. Hopefully this will get resolved but I think in the meantime I will try using react instead
So I have been looking into this myself and tbh I have found it is really easy to add p5 into a svelte app using the cdn link as a script tag in the index.html file. It will probably also work with npm install but I have yet to try that so tbh you don't even need this package
I have the exact same issue, somehow adding the following line helps for now
export default {
input: 'src/main.ts',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js',
inlineDynamicImports: true // ADD THIS
},
?