I’m having an issue with these annoying red squiggly lines showing up under my import statement. It’s really bugging me because the code runs perfectly fine, and everything works as expected. The path I’m using in the require statement is correct and points to the right file in ‘.. > controllers > UserController’. I double-checked it, and there are no typos or mistakes. Despite this, the squiggly lines won’t go away. Has anyone else dealt with this before? Any tips on how to fix it or at least get rid of those distracting lines would be greatly appreciated!
Here is the error shown when hovering over the squiggly lines. The error occurred when I renamed my file.
2
Answers
It is fixed now. I searched for "userController" in the windows search bar and it gave me a file named "userController". When I opened the file in the location, it is referencing to "UserController". Very weird, but when I deleted it and created a new "UserController" file the red squiggly lines is gone.
Something else in your codebase includes the same file, but has the incorrect case for the file. You’re doing this on a case insensitive filesystem, which is why you didn’t get the error the first time.
Look for instances of
userController
to fix this.