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

Warning about legacy package.json format in Svelte package #437

Open
benmccann opened this issue Jan 24, 2024 · 0 comments · May be fixed by #438
Open

Warning about legacy package.json format in Svelte package #437

benmccann opened this issue Jan 24, 2024 · 0 comments · May be fixed by #438

Comments

@benmccann
Copy link

benmccann commented Jan 24, 2024

Description

The following warning is being produced

4:57:38 PM [vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

@egjs/[email protected]

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.

This can be addressed by setting exports. The following fields can probably all be removed: svelte, main, module, es2015. Svelte packages should not be compiled with the Svelte compiler. However, they should be preprocessed to convert any TypeScript code to JavaScript code. This can be difficult to do manually. Svelte provide a svelte-package command to assist with this: https://kit.svelte.dev/docs/packaging. However, the .ts file here is very simple, so one solution would probably be to just rename it .js and remove the build step.

Changing the packaging in this way will be required to continue working with future versions of Svelte, but is a breaking change, so it should be done before a 4.0 release.

Steps to check or reproduce

Use in a Svelte project. E.g. checkout https://github.com/immich-app/immich, cd web, npm install, npm run build

@benmccann benmccann linked a pull request Jan 24, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant