-
-
Notifications
You must be signed in to change notification settings - Fork 173
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(sveltekit): Package subpath './vite' is not defined by "exports" #346
Comments
Thanks for the report. The only solution I can offer at this point is to update Knip to v2.41.1 and rename The issue you link to is indeed relevant, but in the Vite plugin is now loading the Vite config file, since it might contain Vitest configuration that should be parsed for dependencies. Not sure yet how to deal with the Jiti issue, though. |
The situation has further improved in v2.41.2, but it's not fixed yet. The ESM issue and loading TS in general works fine, but calling
|
jiti seems to choke when it hits this file in the vite sveltekit plugin: /** @type {import('typescript')} */
// @ts-ignore
export let ts = undefined;
try {
ts = (await import('typescript')).default;
} catch {} It prints this error:
I'm not very confident I understand what's happening, but it looks like we want to instruct jiti to avoid transforming this file, as it is "already ESM"? I found this jiti thread as well where sveltekit is mentioned. |
Knip v5.1 introduce a new workaround: |
See #565 |
Knip errors on fresh sveltekit project.
Relevant #99
The text was updated successfully, but these errors were encountered: