solid
solid copied to clipboard
Exports from ./dist do not include corresponding type declarations
Describe the bug
When importing directly from solid-js/dist, type declarations are not included alongside the module.
Your Example Website or App
https://stackblitz.com/edit/vitejs-vite-rxucgj
Steps to Reproduce the Bug or Issue
- Go to https://stackblitz.com/edit/vitejs-vite-rxucgj
- Open ./src/main.ts
- Observe the error message on the import (Cannot find module 'solid-js/dist/solid.js' or its corresponding type declarations)
Expected behavior
As a user, I expected imports from dist to have corresponding type declarations, but instead they do not.
Screenshots or Videos
No response
Platform
- OS: Windows
- Browser: N/A
- Version: 1.8.16
Additional context
Technically this isn't a bug, but it is a frustrating developer experience,
The workaround is to declare the types in a type declaration file.
declare module "solid-js/dist/solid.js" {
export * from "solid-js/types/index.d.ts";
}
This is related to #2088, because the goal is the same: I want an entry point to "get exactly what I asked for" without using conditional exports.