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

Error: Invalid value "iife" for option "output.format" #285

Open
wktdev opened this issue Dec 4, 2022 · 5 comments
Open

Error: Invalid value "iife" for option "output.format" #285

wktdev opened this issue Dec 4, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@wktdev
Copy link

wktdev commented Dec 4, 2022

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/[email protected]/node_modules/rollup/dist/shared/rollup.js:198:30)
at validateOptionsForMultiChunkOutput (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/rollup.js:16076:16)
at Bundle.generate (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/[email protected]/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/[email protected]/node_modules/rollup/dist/shared/rollup.js:23833:27
at catchUnfinishedHookActions (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/[email protected]/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/[email protected]/node_modules/rollup/dist/shared/watch.js:246:32)
at Watcher.run (/Users/williamturner/Desktop/new_svelte/my-svelte-project/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/watch.js:173:13)

@wktdev wktdev added the bug Something isn't working label Dec 4, 2022
@jandot
Copy link

jandot commented Dec 9, 2022

Same thing here, I'm afraid.

@rhysw97
Copy link

rhysw97 commented Dec 16, 2022

I seem to have the same error. Hopefully this will get resolved but I think in the meantime I will try using react instead

@rhysw97
Copy link

rhysw97 commented Dec 17, 2022

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

@Treenhan
Copy link

Treenhan commented Jan 7, 2023

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
	},

@919642993
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants