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

Exports from ./dist do not include corresponding type declarations #2118

Open
vveisard opened this issue Apr 3, 2024 · 0 comments
Open

Exports from ./dist do not include corresponding type declarations #2118

vveisard opened this issue Apr 3, 2024 · 0 comments
Labels
typescript relating to typescript or types

Comments

@vveisard
Copy link

vveisard commented Apr 3, 2024

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

  1. Go to https://stackblitz.com/edit/vitejs-vite-rxucgj
  2. Open ./src/main.ts
  3. 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.

@ryansolid ryansolid added the typescript relating to typescript or types label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript relating to typescript or types
Projects
None yet
Development

No branches or pull requests

2 participants