Skip to content

Unable to resolve ./foo.ts to ./foo.d.ts since 3.9.0 #429

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

Closed
silverwind opened this issue Apr 7, 2025 · 4 comments · Fixed by #442
Closed

Unable to resolve ./foo.ts to ./foo.d.ts since 3.9.0 #429

silverwind opened this issue Apr 7, 2025 · 4 comments · Fixed by #442

Comments

@silverwind
Copy link

silverwind commented Apr 7, 2025

I've dug deeper into un-ts/eslint-plugin-import-x#265 and have found the actual cause which is from this module and/or oxc-resolver/unrs-resolver.

Last good version: 3.8.7
First bad version: 3.9.0

Reproduction:

git clone https://github.com/silverwind/resolver-bug && cd resolver-bug
npm i [email protected]
npx eslint index.js # fails with "error  foo not found in 'mod'  import-x/named"
npm i [email protected]
npx eslint index.js # works without error

The problem is that dist/index.d.ts refers a non-existant dist/foo.ts. dist/foo.d.ts exists and it seems 3.8.7 and earlier used it.

If possible I'd request for that behaviour to be restored because I can't seem to get my d.ts generation to fix this without having to do (expensive) type definition bundling.

@silverwind
Copy link
Author

Specifically, I think typescript's File extension substitution may be at least partially be absent in unrs-resolver, but probably was present in enhanced-resolve.

@JounQin
Copy link
Collaborator

JounQin commented Apr 7, 2025

Thanks for reproduction! I'll take a look later, or PR welcome!

@JounQin
Copy link
Collaborator

JounQin commented Apr 21, 2025

Image

I can reproduce it with the latest version of unrs-resolver, it's a bug from there: unrs/unrs-resolver#76, see #442.

@silverwind
Copy link
Author

Thanks, can confirm this is working in both the reproduction repo and my real cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants