sveltejs / vite-plugin-svelte

Svelte plugin for http://vitejs.dev/
MIT License
819 stars 99 forks source link

Named export 'svelteInspector' not found #855

Closed richelleYoj closed 4 months ago

richelleYoj commented 4 months ago

Describe the bug

This error happens when using pnpm and not happening when using npm

How to reproduce:

  1. Execute pnpm install
  2. Execute pnpm dev

This error happens: Screenshot 2024-02-10 161415

Reproduction URL

https://github.com/richelleYoj/svelte-practice

Reproduction

No response

Logs

No response

System Info

Currently using this version:
"@sveltejs/vite-plugin-svelte": "^3.0.2",

pnpm: v8.15.1
dominikg commented 4 months ago

please update the reproduction url to point to your clone and ensure that it is a minimal reproduction.

the error message you posted is wrong, the package. json has type module https://github.com/sveltejs/vite-plugin-svelte/blob/fffb06741db7aa8832d01110ce6783870e4577ab/packages/vite-plugin-svelte-inspector/package.json#L10

richelleYoj commented 4 months ago

Hello @dominikg, I have updated the description and figured that this error only happens when using pnpm. I have a fresh install of svelte in my repo to understand the problem. Thank you.

dominikg commented 4 months ago

I can't reproduce this. On stackblitz, pnpm installs and runs it just fine: https://stackblitz.com/github/richelleYoj/svelte-practice?file=README.md

And @sveltejs/vite-plugin-svelte-inspector is an esm only package. It's exports map explicitly only allows it to be imported with import, there is no require or default.

https://github.com/sveltejs/vite-plugin-svelte/blob/93d75303c0d7669713ece66c9d4a30c8cb786c4f/packages/vite-plugin-svelte-inspector/package.json#L14

No other user has reported this kind of problem before and the only tell i see is that you have a strange onedrive virtual path. Please try to put the project on a local harddrive (preferably c:) and try again.

dominikg commented 4 months ago

please use https://svelte.dev/chat #help-svelte-and-kit to ask for help identifying your problem.

Nrosa01 commented 3 months ago

I'm having that same issue, but it seems it only happens with pnpm for some reason, with npm it works fine