Perhaps the problem is that typescript cannot find the typing for your module OurFirstAppWithFVisualStudio.module.css , which your module cannot solve. Try require styles. If typescript cannot solve the require function, add the following to the .d.ts file
declare interface IRequire { <T>(path: string): T; (paths: string[], callback: (...modules: any[]) => void): void; ensure: (paths: string[], callback: (require: <T>(path: string) => T) => void) => void; } declare var require: IRequire;
In your project. You do not need to do import styles from './...scss' . Just importing or requiring a file should do the trick. Make sure you configure the style loaders in your webpack.config.js or any other bundle if you are not using webpack. You can follow this to configure bootloaders in webpack. If none of them work, maybe you can create declaration files for your css modules using typed-css-modules
source share