million
million copied to clipboard
bug: There's no type declarations for the path "million/preact"
Describe the bug There's no type declarations for the path "million/preact", there's only "react.d.ts" for "million/react" at the root of package "million", and according to the doc, we need to import from "million/preact" to use it with preact. But it will just work as intended if you ignore the type error.
To Reproduce Steps to reproduce the behavior:
- Run command
pnpm add million
in your project folder - Create a file and try to
import { block } from "million/preact"
- See the ts-error
Expected behavior Able to import with no error
Screenshots
Device (please complete the following information):
- Your Computer?
Additional context Nope
Yo @aidenybai, can you check this out?
Hello @Nyaacinth, did you set up your compiler in Preact?
In the documentation, we have the steps follow when setting up Million in Preact
https://million.dev/docs/install can help you out.
Hello @Nyaacinth, did you set up your compiler in Preact?
In the documentation, we have the steps follow when setting up Million in Preact
https://million.dev/docs/install can help you out.
Yes, set vite with million.vite({ mode: "preact" })
, i think the problem is not about the compiler, because the code can run with correct behavior, there're only type errors
Hello @Nyaacinth, did you set up your compiler in Preact?
In the documentation, we have the steps follow when setting up Million in Preact
https://million.dev/docs/install can help you out.
Yes, set vite with
million.vite({ mode: "preact" })
, i think the problem is not about the compiler, because the code can run with correct behavior, there're only type errors
Hmmm, thank you. Let me raise this up with the team and we can have a look. 👀👀
@tobySolutions @Nyaacinth Is this a bug that only happens with pnpm?
Yes, set vite with million.vite({ mode: "preact" }), i think the problem is not about the compiler, because the code can run with correct behavior, there're only type errors
If I restart VSCode after adding it, won't the error stop happening?
Is this a bug that only happens with pnpm?
No, you can install the package with any valid node package manager, but the problem will continue to happen. You can check this.
If I restart VSCode after adding it, won't the error stop happening?
No, to avoid IDE-only errors, I always rerun tsc
for checking,
Overall, it might be only a re-export missing, since there's only export * from './dist/react';
in the "react.d.ts". I think the only thing we need is just a re-export * from './dist/preact';
in the "preact.d.ts" at the root of the package
Actually, you can import from "million/dist/preact"
, and tsc won't complain about it. But there might be some other bugs if you do this.
Confirmed with v2.4.6, the bug still exists
Confirmed with v2.4.6, the bug still exists
It still exists?? 🤔🤔
As it got fixed in the latest release, I'll close this issue. Thank you all for developing this amazing lib!