kriasoft / isomorphic-style-loader

CSS style loader for Webpack that is optimized for isomorphic (universal) web apps.
https://reactstarter.com
MIT License
1.27k stars 144 forks source link

Could not find a declaration file for module 'isomorphic-style-loader/withStyles' #178

Open jsphkm opened 4 years ago

jsphkm commented 4 years ago

Import command leads to this message:

import withStyles from 'isomorphic-style-loader/withStyles';
Could not find a declaration file for module 'isomorphic-style-loader/withStyles'. '/Users/joseph/Code/invoicemanager/node_modules/isomorphic-style-loader/withStyles.js' implicitly has an 'any' type.
  Try `npm install @types/isomorphic-style-loader` if it exists or add a new declaration (.d.ts) file containing `declare module 'isomorphic-style-loader/withStyles';`ts(7016)
"isomorphic-style-loader": "^5.1.0"

@types/isomorphic-style-loader is not in the npm registry.

The import appears to work fine, but I want to know what I should do about this message.

ilan-schemoul commented 4 years ago

You create a d.ts file with "declare module 'isomorphic-style-loader/useStyles';" and you ensure your tsconfig.json has access to where you declared this d.ts file https://stackoverflow.com/questions/21247278/about-d-ts-in-typescript