-
-
Notifications
You must be signed in to change notification settings - Fork 41
import-x/named
resolver bug related to invalid type definitions
#265
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
Comments
Does downgrading I'd make sure that's indeed a regression. |
I tried downgrading all involved dependencies to versions where I know it worked, but no luck so far. Maybe the root cause is in some indirect dependency. One thing I noticed is the error goes away when I remove this setting, so it seems to be involved:
|
But clearly it should work as you expected, I'll take a look when I'm free. |
Thanks. Meanwhile I will enable |
Hmm... I took a look at the reproduction again, I misunderstood the issue, it's not a bug, the malformed
So, closing as working expected. |
That's not possible to do thought because I currently publish my npm modules as JS, not TS and some runtimes like Node.js forbid loading Typescript code from I still think this is a regression, but I can accept it because ultimately it's a bug in the type definition generation. |
My example is for I don't think we ever supported your expected fallback behavior, if it did then it was bug, |
Yeah in the real code, |
I never talked about TypeScript stripping? |
Ah I misunderstood. Yes of course having a What I was getting at was that if only |
I believe it's out of scope here. 😅 |
Yeah, as long as the resolver can load |
I've improved the reproduction and found the actual culprit being |
Reproduction:
Will raise:
mod/index.js
exports the variable, butmod/index.d.ts
which is erronous as it refers a non-existant file does not include that export (which is likely a separate bug in vite-plugin-dts which I'm using to generate these type defs).Deleting
mod/index.d.ts
makes it work, but imho it should just ignore such invalid type definitions and fall back to actual code, like it already does when no type defs are present.This was working in a previous version, but I can't pinpoint which one exactly.
The text was updated successfully, but these errors were encountered: