Skip to content

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

Open
@lotus128

Description

@lotus128

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptrelating to typescript or types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions