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

3.0.0-alpha.8 - extension addition causes failure in presence of exports in package.json #8420

Closed
7 tasks done
benmccann opened this issue May 31, 2022 · 0 comments
Closed
7 tasks done
Labels
feat: ssr p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)
Milestone

Comments

@benmccann
Copy link
Collaborator

Describe the bug

Vite adds an extension for deep imports:
https://github.com/vitejs/vite/pull/8348/files#diff-9b81bb364c02eab9494a7d27a5effc400cacbffd3b8f349c192f890c37bfc83fR639

vite-plugin-svelte resolves svelte as svelte/ssr when ssr: true:
https://github.com/sveltejs/vite-plugin-svelte/blob/0ee99f8ff7a18e7754f7bba373f0dce5817a12a0/packages/vite-plugin-svelte/src/index.ts#L142

Vite sees that the resolved path does not equal the original path and then adds .mjs. This file is not exposed in the exports and so it fails.

We should probably skip adding an extension when exports is present.

Reproduction

https://github.com/sveltejs/kit/tree/vite-3 - need to bump from alpha.6 to alpha.8 and then run pnpm build

System Info

3.0.0-alpha.8

Used Package Manager

pnpm

Logs

> Package subpath './ssr.mjs' is not defined by "exports" in packages/kit/node_modules/svelte/package.json imported from packages/kit/test/prerendering/options/.svelte-kit/output/server/index.js

Validations

@benmccann benmccann added this to the 3.0 milestone May 31, 2022
@benmccann benmccann added bug p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) and removed pending triage labels May 31, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: ssr p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)
Projects
None yet
Development

No branches or pull requests

1 participant