-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Missing "." export in "@sveltejs/kit" package #2384
Comments
I get the same thing once I upgraded to sveltekit 1.0.0-next.164. The two packages for me though are: |
Bump. Same error upon even making a brand new repo. Simply running:
produces:
|
Bump. Same here. SvelteKit v1.0.0-next.164 Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@sveltejs/kit". The package may have incorrect main/module/exports specified in its package.json: Missing "." export in "@sveltejs/kit" package |
This message will be silenced in the next Vite release vitejs/vite#4873 |
Same problem. I tried to use swiper. (Yes, it is installed!) Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@sveltejs/kit". The package may have incorrect main/module/exports specified in its package.json: Missing "." export in "@sveltejs/kit" package Cannot find module 'swiper' from 'C:/Svelte/tw08swip/src/routes/swip' |
Vite had already made another release (2.5.6), what's left is to upgrade Vite |
I cut a release with a new version of Vite |
I think I'm still encountering this error: "devDependencies": {
"@sveltejs/adapter-static": "^1.0.0-next.20",
"@sveltejs/kit": "^1.0.0-next.179",
"svelte": "^3.43.1",
"svelte-preprocess": "^4.9.8",
"typescript": "^4.4.3",
"vite": "^2.6.2",
...
} $ svelte-kit dev
> node_modules/vite/dist/node/chunks/dep-24231913.js:44016:10: error: [plugin: vite:dep-scan] Failed to resolve entry for package "@sveltejs/kit". The package may have incorrect main/module/exports specified in its package.json: Missing "." export in "@sveltejs/kit" package
44016 │ throw new Error(`Failed to resolve entry for package "${id}". ` +
╵ ^
at packageEntryFailure (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:44016:11)
at resolvePackageEntry (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:44012:9)
at tryNodeResolve (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:43787:11)
at Context.resolveId (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:43647:28)
at Object.resolveId (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50533:55)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async resolve (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50720:26)
at async /Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50838:34
at async callback (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:832:28)
at async handleRequest (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:664:30)
node_modules/vite/dist/node/chunks/dep-24231913.js:50828:18: note: This error came from the "onResolve" callback registered here
50828 │ build.onResolve({
╵ ~~~~~~~~~
at setup (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50828:19)
at handlePlugins (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:756:23)
at Object.buildOrServe (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1044:7)
at /Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1886:17
at new Promise (<anonymous>)
at Object.build (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1885:14)
at Object.build (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1740:51)
at /Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50679:54
at Array.map (<anonymous>)
html:/Users/janosh/Repos/tikz/site/src/routes/__error.svelte:18:7: note: The plugin "vite:dep-scan" was triggered by this import
18 │ import '@sveltejs/kit'
╵ ~~~~~~~~~~~~~~~
> node_modules/vite/dist/node/chunks/dep-24231913.js:44016:10: error: [plugin: vite:dep-scan] Failed to resolve entry for package "@sveltejs/kit". The package may have incorrect main/module/exports specified in its package.json: Missing "." export in "@sveltejs/kit" package
44016 │ throw new Error(`Failed to resolve entry for package "${id}". ` +
╵ ^
at packageEntryFailure (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:44016:11)
at resolvePackageEntry (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:44012:9)
at tryNodeResolve (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:43787:11)
at Context.resolveId (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:43647:28)
at Object.resolveId (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50533:55)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async resolve (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50720:26)
at async /Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50838:34
at async callback (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:832:28)
at async handleRequest (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:664:30)
node_modules/vite/dist/node/chunks/dep-24231913.js:50828:18: note: This error came from the "onResolve" callback registered here
50828 │ build.onResolve({
╵ ~~~~~~~~~
at setup (/Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50828:19)
at handlePlugins (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:756:23)
at Object.buildOrServe (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1044:7)
at /Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1886:17
at new Promise (<anonymous>)
at Object.build (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1885:14)
at Object.build (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1740:51)
at /Users/janosh/Repos/tikz/site/node_modules/vite/dist/node/chunks/dep-24231913.js:50679:54
at Array.map (<anonymous>)
html:/Users/janosh/Repos/tikz/site/src/routes/[slug].svelte:40:7: note: The plugin "vite:dep-scan" was triggered by this import
40 │ import '@sveltejs/kit'
╵ ~~~~~~~~~~~~~~~
> Build failed with 2 errors:
node_modules/vite/dist/node/chunks/dep-24231913.js:44016:10: error: [plugin: vite:dep-scan] Failed to resolve entry for package "@sveltejs/kit". The package may have incorrect main/module/exports specified in its package.json: Missing "." export in "@sveltejs/kit" package
node_modules/vite/dist/node/chunks/dep-24231913.js:44016:10: error: [plugin: vite:dep-scan] Failed to resolve entry for package "@sveltejs/kit". The package may have incorrect main/module/exports specified in its package.json: Missing "." export in "@sveltejs/kit" package
Error: Build failed with 2 errors:
node_modules/vite/dist/node/chunks/dep-24231913.js:44016:10: error: [plugin: vite:dep-scan] Failed to resolve entry for package "@sveltejs/kit". The package may have incorrect main/module/exports specified in its package.json: Missing "." export in "@sveltejs/kit" package
node_modules/vite/dist/node/chunks/dep-24231913.js:44016:10: error: [plugin: vite:dep-scan] Failed to resolve entry for package "@sveltejs/kit". The package may have incorrect main/module/exports specified in its package.json: Missing "." export in "@sveltejs/kit" package
at failureErrorWithLog (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1493:15)
at /Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1151:28
at runOnEndCallbacks (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:941:63)
at buildResponseToResult (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1149:7)
at /Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:1258:14
at /Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:629:9
at handleIncomingPacket (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:726:9)
at Socket.readFromStdout (/Users/janosh/Repos/tikz/site/node_modules/esbuild/lib/main.js:596:7)
at Socket.emit (node:events:390:28)
at Socket.emit (node:domain:475:12)
error Command failed with exit code 1. |
In case this helps anyone, I ran into the same problem after replacing all occurrences of
It seems that some imports, such as those importing from <script context="module" lang="ts">
import type { Load } from "@sveltejs/kit";
export const load: Load = async ({ page, fetch }) => { <script context="module">
/**
* @type {import("@svelte/kit").Load}
*/
export async function load({ page, fetch }) { |
If the import consists of type imports only, you need to use |
Thanks for the hint, but then why doesnt sveltekit produce a meaningful error message? This is cropping up again and again and it always takes a while until you figure out where its wrong. |
@bluwy I suspect this error is thrown by either vite or vps - is there a way to throw a different error there, something like "X is not a valid import from Y. If this is a type import, use the import type syntax." or sth like that? |
From the errors, looks like it's coming from Vite's dep scanner, which uses esbuild to process TS, and it tries to resolve |
Does this have a fix yet? I get the same or a similar bug when I add the bug states:
|
I can't reproduce this anymore. The errors come around when you |
Haven't encountered this in a long time either. |
Describe the bug
When issue
npm run build
get this errorReproduction
npm run build
My svelte.config.js
My package.json
Logs
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: