-
-
Notifications
You must be signed in to change notification settings - Fork 8k
SSR resolve always happens as require even when it's an import #10352
Copy link
Copy link
Labels
feat: ssrp3-downstream-blockerBlocking the downstream ecosystem to work properly (priority)Blocking the downstream ecosystem to work properly (priority)
Description
Describe the bug
Svelte has a package.json in each directory to support older versions of Node. On Node 12+ the exports map will be used. Even on newer versions of Node, Vite appears to be looking at the nested package.json rather than the exports map, which is incorrect. This only happens with the external config.
Originally reported in sveltejs/vite-plugin-svelte#360
Reproduction
git clone [email protected]:benmccann/context-issue.git
cd context-issue/svelte-kit-app
npm install
npm run dev
System Info
System:
OS: macOS 12.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 293.67 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.9.0 - ~/.nvm/versions/node/v17.9.0/bin/node
Yarn: 1.22.18 - ~/.nvm/versions/node/v17.9.0/bin/yarn
npm: 8.5.5 - ~/.nvm/versions/node/v17.9.0/bin/npm
Browsers:
Chrome: 102.0.5005.61
Firefox: 100.0.2
Safari: 15.4
Safari Technology Preview: 15.4
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.50
@sveltejs/kit: next => 1.0.0-next.347
svelte: ^3.44.0 => 3.48.0Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: ssrp3-downstream-blockerBlocking the downstream ecosystem to work properly (priority)Blocking the downstream ecosystem to work properly (priority)