Skip to content

Missing "." export in "@sveltejs/kit" package #2384

Closed
@jacobbogers

Description

@jacobbogers

Describe the bug

When issue npm run build get this error

Reproduction

npm run build

My svelte.config.js

import preprocess from 'svelte-preprocess';
const config = {

	kit: {
		amp: false,
		appDir: '_app',
		files: {
			assets: 'static',
			//hooks: 'src/hooks',
			lib: 'src/lib',
			routes: 'src/routes',
			serviceWorker: 'src/service-worker.ts',
			template: 'src/app.html'
		},
		floc: false,
		hydrate: true,
		package: {
		 	files: {
		 		exclude: ['**/*.test.ts']
		 	}
		},
		prerender: {
			crawl: true,
			enabled: true,
			onError: 'continue',
			pages: ['*']
		},
		router: true,
		ssr: true,
		target: '#svelte',
		trailingSlash: 'never'
	},
	preprocess: preprocess({
		replace: [['process.env.NODE_ENV', JSON.stringify(process.env.NODE_ENV)]],
	}),
};

export default config;

My package.json

{
  "name": "~TODO~",
  "version": "0.0.1",
  "scripts": {
    "dev": "svelte-kit dev",
    "build": "svelte-kit build",
    "preview": "svelte-kit preview",
    "check": "svelte-check --tsconfig ./tsconfig.json",
    "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
    "lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
    "format": "prettier --write --plugin-search-dir=. .",
    "test": "jest"
  },
  "//": "force install svelte-jester on version 1.8.2, 2.1.1 is broken and being fixed",
  "devDependencies": {
    "@sveltejs/kit": "next",
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/svelte": "^3.0.3",
    "@types/jest": "^27.0.1",
    "@typescript-eslint/eslint-plugin": "^4.19.0",
    "@typescript-eslint/parser": "^4.19.0",
    "eslint": "^7.22.0",
    "eslint-config-prettier": "^8.1.0",
    "eslint-plugin-svelte3": "^3.2.0",
    "jest": "^27.1.0",
    "jest-localstorage-mock": "^2.4.17",
    "prettier": "~2.2.1",
    "prettier-plugin-svelte": "^2.2.0",
    "svelte": "^3.34.0",
    "svelte-check": "^2.0.0",
    "svelte-jester": "1.8.2",
    "svelte-preprocess": "^4.0.0",
    "ts-jest": "^27.0.5",
    "tslib": "^2.0.0",
    "typescript": "^4.0.0"
  },
  "type": "module"
}

Logs

npm run build

> ~TODO~@0.0.1 build
> svelte-kit build

vite v2.5.4 building for production...
✓ 30 modules transformed.
.svelte-kit/output/client/_app/manifest.json                               1.30 KiB
.svelte-kit/output/client/_app/error.svelte-89ee8862.js                    1.55 KiB / brotli: 0.64 KiB
.svelte-kit/output/client/_app/pages/__layout.svelte-a8251f0c.js           0.72 KiB / brotli: 0.41 KiB
.svelte-kit/output/client/_app/assets/start-61d1577b.css                   0.16 KiB / brotli: 0.11 KiB
.svelte-kit/output/client/_app/assets/pages/__layout.svelte-3c7a1a64.css   0.72 KiB / brotli: 0.37 KiB
.svelte-kit/output/client/_app/assets/pages/index.svelte-7545cfa0.css      2.71 KiB / brotli: 0.65 KiB
.svelte-kit/output/client/_app/chunks/vendor-401acf23.js                   7.57 KiB / brotli: 2.79 KiB
.svelte-kit/output/client/_app/pages/index.svelte-0ea4a5cb.js              10.38 KiB / brotli: 3.38 KiB
.svelte-kit/output/client/_app/start-2fb977ed.js                           17.60 KiB / brotli: 5.62 KiB
vite v2.5.4 building SSR bundle for production...
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     
Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/jest". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/jest". The package may have incorrect main/module/exports specified in its package.json.
✓ 29 modules transformed.
.svelte-kit/output/server/app.js   83.31 KiB
vite v2.5.4 building for production...
✓ 2 modules transformed.
.svelte-kit/output/client/service-worker.js   0.41 KiB / brotli: 0.20 KiB

Run npm run preview to preview your production build locally.

System Info

node version: v16.3.0
svelte-kit, 1.0.0-next.164

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions