-
Notifications
You must be signed in to change notification settings - Fork 89
Typescript error: index.d.ts file is missing #147
Comments
I believe it has to do with the fact that they are, in fact, included. As you can see from looking at the package contents:
Compare that with the last release:
Looking at the As a temporary workaround, you can add these lines to
Thanks for the awesome project by the way, we use it every day in production here and it's been working great. 🎉 |
I honestly have no idea how those files ended up there. I did not use TS to create hookrouter, so no idea what generated them 🤔 However - I am working on v2.0 in a separate branch of this repo - this time even based on TS 😁🤫 |
Hey @Paratron, If you will look at the build output for version 1.2.5, then you will see that it includes code from version 2.0. based on TS. You have somehow created wrong build with code from branch v2-ts. See at routes.js, routes.d.ts, index.js, index.d.ts (which is actually empty)... It would be great if you can just publish fixed build for 1.2.5 (as 1.2.6) without changes from branch v2-ts |
Hi. Yes, a new version without those files would be great because 1.2.5 AND 1.2.4 are unusable with typescript without removing those files manually. |
If you're using yarn, @pbondoer 's solution works. You can add that to your scripts that run and not have to do it manually. Not sure if npm (my preferred package manager anyway) has a similar command. I'm currently on a project using yarn.... |
…krouter#147 (perform yarn autoclean --force after that)
Hacky workaround for npm using a postinstall script: # package.json
{
"scripts": {
"cleanup-hookrouter-types": "rm -f node_modules/hookrouter/dist/index.d.ts* # See https://github.com/Paratron/hookrouter/issues/147",
"postinstall": "npm run cleanup-hookrouter-types"
}
} |
Hi guys, I've recently upgraded from 1.2.3 to 1.2.5 and getting the same issue here. Is the solution provided by @pbondoer one that is usable in a build/deploy (CI/CD) environment? UPDATE: I attempted the .yarnclean and it seems to work locally. I'll give this a go by running in our CI environment. I hadn't used yarn clean before, didn't realise it'll run on every yarn install. Cheers. |
Thanks for the workaround. I'm surprised to see the project basically abandoned. Wish I had time to contribute. Thanks for all the fish |
After upgrading the library from 1.2.3 to 1.2.5 I started to see
hookrouter/dist/index.d.ts is not a module
error. I think it's because*.d.ts
files are not included with hookrouter/dist folder anymore.The text was updated successfully, but these errors were encountered: