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

Building for legacy browsers fails #1788

Closed
lovasoa opened this issue Jun 30, 2021 · 1 comment
Closed

Building for legacy browsers fails #1788

lovasoa opened this issue Jun 30, 2021 · 1 comment

Comments

@lovasoa
Copy link
Contributor

lovasoa commented Jun 30, 2021

Describe the bug

Can a svelte kit app work on browsers without native es modules support ?

I tried using @vitejs/plugin-legacy, but compilation fails with the following error.

Logs

 > @vitejs/plugin-legacy does not support library mode.
Error: @vitejs/plugin-legacy does not support library mode.
    at Object.configResolved (/home/runner/work/sanipasse/sanipasse/node_modules/@vitejs/plugin-legacy/index.js:162:15)
    at /home/runner/work/sanipasse/sanipasse/node_modules/vite/dist/node/chunks/dep-0ed4fbc0.js:71748:127
    at Array.map (<anonymous>)
    at resolveConfig (/home/runner/work/sanipasse/sanipasse/node_modules/vite/dist/node/chunks/dep-0ed4fbc0.js:71748:35)
    at async doBuild (/home/runner/work/sanipasse/sanipasse/node_modules/vite/dist/node/chunks/dep-0ed4fbc0.js:45273:20)
    at async Object.build (/home/runner/work/sanipasse/sanipasse/node_modules/vite/dist/node/chunks/dep-0ed4fbc0.js:45261:16)
    at async build_service_worker (file:///home/runner/work/sanipasse/sanipasse/node_modules/@sveltejs/kit/dist/chunks/index4.js:710:2)
    at async build (file:///home/runner/work/sanipasse/sanipasse/node_modules/@sveltejs/kit/dist/chunks/index4.js:239:3)
    at async file:///home/runner/work/sanipasse/sanipasse/node_modules/@sveltejs/kit/dist/cli.js:873:23

https://github.com/lovasoa/sanipasse/runs/2956707572?check_suite_focus=true

To Reproduce

in svelte config

 import vite_plugin_legacy from '@vitejs/plugin-legacy';

...

const config = {
	preprocess: preprocess(),
	kit: {
		target: '#svelte',
		adapter,
		vite: {
			plugins: [
				vite_plugin_legacy({
					targets: ['ie >= 11'],
					additionalLegacyPolyfills: ['regenerator-runtime/runtime']
				})
			],

Information about your SvelteKit Installation:

Diagnostics
  Binaries:
    Node: 16.1.0 - /usr/local/bin/node
    npm: 7.11.2 - /usr/local/bin/npm

  npmPackages:
    @sveltejs/adapter-node: next => 1.0.0-next.24 
    @sveltejs/adapter-static: next => 1.0.0-next.13 
    @sveltejs/kit: next => 1.0.0-next.113 
    svelte: ^3.38.2 => 3.38.2 

Severity

blocking some users

@Conduitry
Copy link
Member

This isn't supported yet, but is on the roadmap post-1.0 - #12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants