Next.js Discord

Discord Forum

Module not found on deployment: Can't resolve '@/components/navbar'

Answered
British Shorthair posted this in #help-forum
Open in Discord
British ShorthairOP
This is the first time I'm seeing this problem. It's weird because on development mode everything works fine, but on deployment it shows this error:
I'm importing a Navbar component from the main page of my website app/[lang]/page.tsx. The navbar is located at components/navbar. Can someone tell me where the problem is?

9 Replies

Answer
British ShorthairOP
well i only changed the first letter from uppercase to lowercase
but I changed all imports
and in development mode it works fine
yeah then it's definitely due to casing
go check the filename on github and use the casing there
on windows/mac the fs is case insensitive so we cannot really trust the casing displayed by vscode
British ShorthairOP
ok thanks
it works now