[ts] Cannot find module './<>.module.scss'.
Category - Bug
I have the module.scss file in the same place where it is referred . But I get error [ts] Cannot find module './GraphConsumer.module.scss' in the .tsx file in components folder. The same for AadHttpClient import { AadHttpClient } from "@microsoft/sp-http". Can you please help me in solving
When you reference the scss file like './GraphConsumer.module.scss'; you are actually referencing the GraphConsumer.module.scss.ts file that gets generated when you build it (gulp serve) so it will often show an error in the editor until you do the initial build.
Could you provide more details about the 2nd issue with AadHttpClient. What version of SPFx are you using? Thanks!
Closing as no response to Chris's question.
Hi,
We actually encountered the same issue, scss module not being recognized. What is strange is that when generating the project from scratch, everything works fine, but checking out the very generated project from repo, installing dependencies and running gulp serve throws this:
[16:47:11] Error - typescript - src/webparts/testProject/components/testProject.tsx(2,20): error TS2307: Cannot find module './testProject.module.scss'.
Modifying and saving the scss file however solves the problem and the error disappears :/
I am not sure how to check which version of SPFx (whatever that is) are we using, but all the @microsoft/sp-* packages are of version 1.5.1
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues