-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Could not find a declaration file for module 'next-test-api-route-handler'. #908
Comments
Thanks for this and especially the suggested solutions. Coincidentally, I was checking NTARH on arethetypeswrong a few days ago and pondering solutions. I'll address this sooner than planned since this is causing problems in the wild. I haven't make the leap to node16 resolution in my TS stack yet, which let this slip under the radar. I'll have to update a few other projects as well 😄 |
No problem - thanks for picking this up so fast! Seems to be a common issue so hopefully not too much trouble. Best of luck with it! |
## [4.0.0-canary.2](v4.0.0-canary.1...v4.0.0-canary.2) (2023-11-04) #### ⚙️ Build system * Add core-js polyfills and have mercy on aging node versions ([a9d136b](a9d136b)) * Modernize tooling ([db0223e](db0223e)) * Upgrade typescript-babel toolchain to nodenext ([e457064](e457064)) <sup>closes [#908](https://github.com/Xunnamius/next-test-api-route-handler/issues/908)</sup>
🎉 This issue has been resolved in version 4.0.0-canary.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
### [3.1.10](v3.1.9...v3.1.10) (2023-11-04) #### ⚙️ Build system * Add core-js polyfills and have mercy on aging node versions ([a9d136b](a9d136b)) * Modernize tooling ([db0223e](db0223e)) * Upgrade typescript-babel toolchain to nodenext ([e457064](e457064)) <sup>closes [#908](https://github.com/Xunnamius/next-test-api-route-handler/issues/908)</sup>
🎉 This issue has been resolved in version 3.1.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The problem
Hi! The import
import { testApiHandler } from "next-test-api-route-handler";
gives me the following typescript error:I think the issue is related to prs such as:
types
to defaultexports
unjs/unbuild#226types
condition to thepackage.json#exports
gxmari007/vite-plugin-eslint#60Reproduction steps
For basic reproduction: https://github.com/jakejones2/next-test-api-route-handler-import
Suggested solution
A quick fix seems to be changing package.json as follows:
However, looking at similar pull requests, the problem might require an index.d.mts file. Something like this:
Additional context
node v.20.4.0
npm v.9.7.2
The text was updated successfully, but these errors were encountered: