Next.js Discord

Discord Forum

Module not found, can't resolve layout and opengraph

Unanswered
Tropical Parula posted this in #help-forum
Open in Discord
Avatar
Tropical ParulaOP
I get a problem when trying to deploy my project to Vercel. I have had one page on src/app/foo which has a page, layout and some metadata. Now I want to move that page to src/app/bar/foo and instead put another page on src/app/foo which doesn't have a layout or metadata.

The problem is that when I put a new page to the old path, the deployment fails as:
Module not found: Can't resolve '/vercel/path0/src/app/foo/layout.tsx'
Module not found: Can't resolve '/vercel/path0/src/app/foo/opengraph-image.jpg?__next_metadata__

If I rename the new page to src/app/foo2 it will work.
I've tried removing .next, .vercel and node_modules but it makes no difference. I've tried to purge all the cached data on Vercel but that also didn't do anything. Are there other caches I'm missing?

0 Replies