You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting a new Vite project and selecting svelte-ts template (by first selecting svelte and then TypeScript) results in an error, because code var in error.js is null.
Start a new Vite project using npm create vite@latest
Install dependencies in project folder with npm install
Start dev server with npm run dev
Observe error.
Logs
[vite] Internal server error: Cannot read properties of undefined (reading 'startsWith')
Plugin: vite-plugin-svelte
File: /***/src/App.svelte
at couldBeFixedByCssPreprocessor (file://***/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@5.0.2_svelte@5.14.2_vite@6.0.3/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js:111:72)
at enhanceCompileError (file://***/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@5.0.2_svelte@5.14.2_vite@6.0.3/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js:126:6)
at compileSvelte (file:/***/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@5.0.2_svelte@5.14.2_vite@6.0.3/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js:148:4)
at async TransformPluginContext.transform (file:/***/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@5.0.2_svelte@5.14.2_vite@6.0.3/node_modules/@sveltejs/vite-plugin-svelte/src/index.js:164:20)
at async EnvironmentPluginContainer.transform (file:/***/node_modules/.pnpm/vite@6.0.3/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js:47001:18)
at async loadAndTransform (file:/***/node_modules/.pnpm/vite@6.0.3/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js:40852:27)
at async viteTransformMiddleware (file:/***/node_modules/.pnpm/vite@6.0.3/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js:42296:24)
Describe the bug
Starting a new Vite project and selecting svelte-ts template (by first selecting svelte and then TypeScript) results in an error, because
code
var in error.js is null.Reproduction URL
https://github.com/vitejs/vite/tree/main/packages/create-vite/template-svelte-ts
Reproduction
npm create vite@latest
npm install
npm run dev
Logs
System Info
The text was updated successfully, but these errors were encountered: