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

Package.json subpath imports do not work #249

Open
jakst opened this issue Mar 11, 2024 · 6 comments
Open

Package.json subpath imports do not work #249

jakst opened this issue Mar 11, 2024 · 6 comments

Comments

@jakst
Copy link
Contributor

jakst commented Mar 11, 2024

When updating solid-start from v0.6.0 to v0.7 I started getting this crash in the dev server for any page load. Not sure which underlying vinxi package is causing it though.

[h3] [unhandled] H3Error: Missing "#vinxi/handler/ssr" specifier in "app" package
    at e (file://./node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-G-px366b.js:47398:25)

Turns out it's caused by specifying subpath imports in package.json. Even an empty object will trigger.

package.json

{
  // ...
  "imports": {}
  // ...
}

Here's a stackblitz reproduction https://stackblitz.com/edit/solidjs-solid-start-wtwqtu

@nksaraf
Copy link
Owner

nksaraf commented Mar 11, 2024

what are "imports", i apologize i'm not familiar, so if you could explain what it does and why u need it, that would help in getting some direction

@jakst
Copy link
Contributor Author

jakst commented Mar 12, 2024

It's like tsconfig paths, but standardized. TS started supporting it for auto imports in v5.4, so it just recently became usable for real. This avoids a lot of tooling having to read the tsconfig file just to resolve paths.

You can read more here
https://betterprogramming.pub/the-native-way-to-configure-path-aliases-in-frontend-projects-5db70f19a6e0

@nksaraf
Copy link
Owner

nksaraf commented Mar 14, 2024

does vite support it?

@jakst
Copy link
Contributor Author

jakst commented Mar 14, 2024

Yes. vitejs/vite#7385 vitejs/vite#7770

Not completely sure which Vinxi version is causing the issues, but they started when upgrading from solid-start v0.6.0 to v0.7. Definitely worked with Vite before that.

@nksaraf
Copy link
Owner

nksaraf commented Mar 16, 2024

Ahh okay lemme see what's wrong. If vite supports it we should be able to get it working too

@Akkuma
Copy link
Contributor

Akkuma commented Apr 21, 2024

This is still an issue as of 0.3.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants