Webstorm typescript : keeps saying change file extension to .tsx when the file's extension is .tsx
I am currently using NextJS + typescript with webstorm. I am not sure what I pressed along the way of coding but at some point, the file does not recognize its path or html.
As you can see the above picture, at line 5, I am more than 100% that the cls function exists in that path and am using it in the return statement starting at line 31 but is not recognizing it. I dont know what I missed if anyone knows the answer, please let me know
请先登录再写评论。
Please try invalidating caches (File > Invalidate caches, Invalidate and Restart) - does the issue persist? If yes, please share a screenshot of quick documentation popup shown when you select your
.tsxfile in Project explorer and hitF1(or whatever shortcut is assigned to View | Quick documentation action)Elena Pogorelova



Thanks for the reply. I invlaidated cache but it is still giving me the same error.
The last picture is the quick documentation of selected.tsx file. (Basically, all the tsx files when I click them, output the following errors)
In Preferences | Editor | File Types, please re-assign *.tsx pattern to Typescript JSX file type; seems that you have either the *.tsx or input.tsx assigned to TypeScript file type
wow solved perfectly fine . THanks!