NextJS "Module not found" error with "loading.tsx"?

PS: i replaced the absolute path with <path> in the image....
7 Replies
z
zOP2y ago
why does it wants me to have a loading.tsx it should be optional?
Huperniketes
Huperniketes2y ago
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?
JulieCezar
JulieCezar2y ago
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
Huperniketes
Huperniketes2y ago
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.
z
zOP2y ago
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
cornflour
cornflour2y ago
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?
z
zOP2y ago
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
Want results from more Discord servers?
Add your server