braintree / sanitize-url

MIT License
307 stars 35 forks source link

Typescript declaration file confusion #25

Closed jf-t closed 3 years ago

jf-t commented 3 years ago

Running a production build of our Typescript application is now showing me:

Could not find a declaration file for module '@braintree/sanitize-url'. '/usr/src/app/node_modules/@braintree/sanitize-url/dist/index.js' implicitly has an 'any' type.

In the console log and I am unable to run a build. I originally had the DefinitelyTyped package installed, which was recently overwritten as you are including a dist folder.

From what I see, node is trying to read index.js file for some reason, when it should be reading index.d.ts? but I am not sure a way around this. I have version 4.1.0 installed, and it seemingly works for me locally, but only fails when running a production build.

crookedneighbor commented 3 years ago

Can you make a sample repo that reproduces the problem?

jf-t commented 3 years ago

Sorry I don't have time currently to do that - I forced my package back to version 4.0.1 and the issue went away so I am sure this is the problem. When I have a few hours to spend I will make a sample repo and try to reproduce it that way, sorry about that.

crookedneighbor commented 3 years ago

I was able to reproduce locally. Looking into fixing it up.

crookedneighbor commented 3 years ago

Fixed in v4.1.1

jf-t commented 3 years ago

Thank you! @crookedneighbor I will try our site to use 4.1.1 tomorrow.

jf-t commented 3 years ago

This fixed it :+1: