Skip to content
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

[Bug] ERR_PACKAGE_PATH_NOT_EXPORTED error with SvelteKit 1.0.0 and Vite 4 #532

Closed
1 task
vekunz opened this issue Dec 16, 2022 · 2 comments
Closed
1 task
Labels
bug Something isn't working

Comments

@vekunz
Copy link

vekunz commented Dec 16, 2022

What version of vite are you using?

4.0.0

System info and storybook versions

System:
OS: Windows 10 10.0.19045
CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
Binaries:
Node: 16.19.0 - C:\Program Files\nodejs\node.EXE
npm: 8.13.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 108.0.5359.100
Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.46)
npmPackages:
@storybook/addon-actions: ^6.5.14 => 6.5.14
@storybook/addon-essentials: ^6.5.14 => 6.5.14
@storybook/addon-interactions: ^6.5.14 => 6.5.14
@storybook/addon-links: ^6.5.14 => 6.5.14
@storybook/builder-vite: ^0.2.5 => 0.2.5
@storybook/svelte: ^6.5.14 => 6.5.14
@storybook/testing-library: ^0.0.13 => 0.0.13

Describe the Bug

With the latest SvelteKit 1.0.0 with Vite 4.0.0, Storybook just crashes right after start with npm run storybook.

To reproduce, just run npm install and npm run storybook in the reproduction repo.

ERR! Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\path-to-repo\node_modules\@sveltejs\vite-plugin-svelte\package.json
ERR!     at new NodeError (node:internal/errors:387:5)
ERR!     at throwExportsNotFound (node:internal/modules/esm/resolve:365:9)
ERR!     at packageExportsResolve (node:internal/modules/esm/resolve:589:7)
ERR!     at resolveExports (node:internal/modules/cjs/loader:529:36)
ERR!     at Function.Module._findPath (node:internal/modules/cjs/loader:569:31)
ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:981:27)
ERR!     at Function.Module._load (node:internal/modules/cjs/loader:841:27)
ERR!     at Module.require (node:internal/modules/cjs/loader:1067:19)
ERR!     at require (node:internal/modules/cjs/helpers:103:18)
ERR!     at pluginConfig (C:\path-to-repo\node_modules\@storybook\builder-vite\dist\vite-config.js:161:34)
ERR!  Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\path-to-repo\node_modules\@sveltejs\vite-plugin-svelte\package.json
ERR!     at new NodeError (node:internal/errors:387:5)
ERR!     at throwExportsNotFound (node:internal/modules/esm/resolve:365:9)
ERR!     at packageExportsResolve (node:internal/modules/esm/resolve:589:7)
ERR!     at resolveExports (node:internal/modules/cjs/loader:529:36)
ERR!     at Function.Module._findPath (node:internal/modules/cjs/loader:569:31)
ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:981:27)
ERR!     at Function.Module._load (node:internal/modules/cjs/loader:841:27)
ERR!     at Module.require (node:internal/modules/cjs/loader:1067:19)
ERR!     at require (node:internal/modules/cjs/helpers:103:18)
ERR!     at pluginConfig (path-to-repo\node_modules\@storybook\builder-vite\dist\vite-config.js:161:34) {
ERR!   code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
ERR! }

Link to Minimal Reproducible Example

https://github.com/vekunz/storybook-svelte-error

Participation

  • I am willing to submit a pull request for this issue.
@vekunz vekunz added the bug Something isn't working label Dec 16, 2022
@IanVS
Copy link
Member

IanVS commented Dec 16, 2022

Thanks, I'll work on updating this package for vite 4 soon. Svelte has gone to ESM only, which is causing some headaches for us.

@IanVS
Copy link
Member

IanVS commented Feb 16, 2023

The latest 0.4.x version of this package supports Vite 4, but there seems to be an issue with mdx styling. I'm going to close this out, but let me know if it's still an issue, and keep an eye on #561 for the styling bug.

@IanVS IanVS closed this as completed Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants