-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
awaiting submitterneeds a reproduction, or clarificationneeds a reproduction, or clarification
Description
Describe the bug
After updating from 230 to 240, which includes the context="module" to module change, and updating my script tags to just use module, I am getting errors when running npm run dev. The actual code does what I expect though.
Error: Failed to scan for dependencies from entries:
/Users/minds/repos/test2/src/routes/+page.svelte
✘ [ERROR] No matching export in "html:/Users/minds/repos/test2/src/lib/ComponentB.svelte" for import "someExport"
script:/Users/minds/repos/test2/src/lib/ComponentA.svelte?id=0:2:10:
2 │ import { someExport } from '$lib/ComponentB.svelte';
╵ ~~~~~~~~~~
at failureErrorWithLog (/Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1472:15)
at /Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:945:25
at runOnEndCallbacks (/Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1315:45)
at buildResponseToResult (/Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:943:7)
at /Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:955:9
at new Promise (<anonymous>)
at requestCallbacks.on-end (/Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:954:54)
at handleRequest (/Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:647:17)
at handleIncomingPacket (/Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:672:7)
at Socket.readFromStdout (/Users/minds/repos/test2/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:600:7)Reproduction
Create a new skeleton application using pnpm create svelte@latest and add the following three files:
src/lib/routes/+page.svelte
<script>
import ComponentA from '$/lib/ComponentA.svelte';
</script>
<ComponentA />src/lib/ComponentA.svelte
<script>
import { someExport } from '$lib/ComponentB.svelte';
function onClick() {
console.log(someExport.foo);
}
</script>
<button onclick={onClick}>Click me</button>src/lib/ComponentB.svelte
<script module>
export const someExport = { foo: 'bar' };
</script>Then run pnpm run dev. You will see the beforementioned errors. If I switch back to using context="module", it works again.
Logs
No response
System Info
System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M1 Pro
Memory: 72.22 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.19.1 - ~/.nvm/versions/node/v18.19.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v18.19.1/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v18.19.1/bin/npm
pnpm: 9.9.0 - /opt/homebrew/bin/pnpm
bun: 1.1.26 - /opt/homebrew/bin/bun
Browsers:
Chrome: 127.0.6533.122
Safari: 17.6
npmPackages:
svelte: ^5.0.0-next.240 => 5.0.0-next.240Severity
annoyance
stephanedemotte and ximus
Metadata
Metadata
Assignees
Labels
awaiting submitterneeds a reproduction, or clarificationneeds a reproduction, or clarification