NextJS "Module not found" error with "loading.tsx"?
PS: i replaced the absolute path with <path> in the image....
7 Replies
why does it wants me to have a loading.tsx it should be optional?
That isn't the actual error, and I don't recall what the cause was when I got this error. What was the last change you made?
Isn't loading required if you are using suspense?
Maybe iI'm wrong tho... there are still a lot of bugs with the newer features
I found the source for the error I experienced: I imported the needed definition from the wrong file. When I used the correct file reference, the error went away and the build completed.
I am not using suspense at all
actually i should i have said this:
i wasnt having this issue before, but then i tried to use suspense and loading.tsx and it didnt work (i prob did it incorrectly) so i removed it.
but after i removed its trying to force me to have a loading.tsx...
- ive tried restarting server
- deleting node_modules & .next folder
- even restarted my laptop
i did have this issue too when i tried to delete a loading.tsx
but it seems to have fixed it when i deleted .next, so idk about your case
how about cloning your repo again and try to run it from there?
i guess thats the last solution
I dont know why but deleting .next this time worked; I may have not closed the server last time (?) idk if that made a difference but cool its fixed now.
TLDR; if ur facing this issue
- close dev server
- delete .next folder
- start dev server