solid icon indicating copy to clipboard operation
solid copied to clipboard

Exports from ./dist do not include corresponding type declarations

Open vveisard opened this issue 10 months ago • 0 comments

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.

vveisard avatar Apr 03 '24 21:04 vveisard