Skip to content
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 declaration file for module chalk #142

Closed
hareacostica opened this issue Aug 10, 2018 · 12 comments
Closed

Could not find declaration file for module chalk #142

hareacostica opened this issue Aug 10, 2018 · 12 comments

Comments

@hareacostica
Copy link

After updating to v0.4.5 it starts complaining about types for module chalk.
After setting skipLibCheck to true in tsconfig eveything is fine, but isn't better to have this set by default with fork-ts-checker-webpack-plugin as explained here?

@johnnyreilly
Copy link
Member

Could you post a reproduction please? Also, can you confirm if you are not using @types/chalk? Remember that chalk ships with it's own types now: https://github.com/chalk/chalk/tree/master/types

@hareacostica
Copy link
Author

here is the reproduction.
I am using node LTS v8.11.3 and npm 5.6.0.
Chalk i dont use.

@johnnyreilly
Copy link
Member

johnnyreilly commented Aug 10, 2018

Ah the problem is that we need to update the chalk version fork-ts-checker-webpack-plugin uses. It's using a version that is very old.... Would you like to submit a PR that updates chalk to the latest and greatest and removes @types/chalk?

@johnnyreilly
Copy link
Member

johnnyreilly commented Aug 11, 2018

This should be fixed in 0.4.7 - can you confirm @hareaca ?

@hareacostica
Copy link
Author

@johnnyreilly yes, chalk now is fine, but now there is an issue with @types/webpack. If i install them in the project everything works fine (but i suppose i dont have to, as i dont have a direct dependency to webpack). Also tried to update them in fork-ts-checker-webpack-plugin, but after that build is not working.

@johnnyreilly
Copy link
Member

after that build is not working

Could you share the error you encounter please?

Also, could you try removing @types/webpack from fork-ts-checker-webpack-plugin and updating the webpack devDependency to the latest one? It looks like webpack may now be shipping with types in the box...

@hareacostica
Copy link
Author

@johnnyreilly Submited a PR, hope it's the last fix for this issue.

@hareacostica
Copy link
Author

@johnnyreilly Looks like the issue with @types/webpack persists. I checked in node_modules and it's not getting installed. Maybe npm is not getting that needs to install that? I see an old issue from npm, maybe its something similar?
I can confirm that after installing @types/webpack everything its ok.

@johnnyreilly
Copy link
Member

Hey @hareaca,

So I suspect the reason you're encountering this is that @types/webpack is a devDependency and not a dependency. I'm guessing that it should be switched.... However I've got mixed feelings in that this means that everyone using fork-ts-checker-webpack-plugin will end up installing @types/webpack whether they need it or not...

@hareacostica
Copy link
Author

@johnnyreilly So, actually it make sense to have installed locally @types/webpack as it's a dev dependency? And it actually had to be added by react-scripts-ts in my case (as he ads webpack as a dependency)?

@johnnyreilly
Copy link
Member

So, actually it make sense to have installed locally @types/webpack as it's a dev dependency?

I think so yes!

@hareacostica
Copy link
Author

@johnnyreilly Got it. Thanks!

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

No branches or pull requests

2 participants