Next.js Discord

Discord Forum

[Error: Could not find a production build in the '.next' directory. Try building your app with 'next

Answered
Griffon Bleu de Gascogne posted this in #help-forum
Open in Discord
Griffon Bleu de GascogneOP
this error just randomly poped up, i did npm run build and it created a build but when i do npm run start, it didnt work
Answered by Griffon Bleu de Gascogne
wait for some reason its working td
View full answer

13 Replies

Griffon Bleu de GascogneOP
please help
Delete the .next folder and try again.
A little more context would help. Have you touched your package.json scripts commands?

Have you tried deleting the node_modules?

Does this happen with npm run dev?
@LuisLl Delete the .next folder and try again.
Griffon Bleu de GascogneOP
i tried
i redid it and it didn’t work
the same thing
i haven’t touched any json file
Griffon Bleu de GascogneOP
wait for some reason its working td
Answer
@Griffon Bleu de Gascogne wait for some reason its working td
That’s not a solution, mods won’t like it.

See if you can identify what the problem was and share it in the thread, maybe deleting the .next folder solved it and you didn’t notice.
I deleted the .next folder, retried and didn't work, but for some reason today it works
can you test if changing the distDir in next.config.ts gives the same output?
i think i should fix it...