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

0

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 .tsx file in Project explorer and hit F1 (or whatever shortcut is assigned to View | Quick documentation action)

0

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)

0

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

0

wow solved perfectly fine . THanks!

1

请先登录再写评论。