Production build error v14
Answered
Spectacled bear posted this in #help-forum
Spectacled bearOP
Hey People, I'm getting a build error when make
* I made it with ceate-next-app
* Next.js version 14.0.1 with app directory and src folder
* In development mode (yarn dev) it's working fine.
Thanks in advance.
SOLUTION: the NODE_ENV variable must have the value "production" and the error occurred when I tried to build with this variable as "development".
yarn build, I got this error (image related), please, know someone why this happended or what means?* I made it with ceate-next-app
* Next.js version 14.0.1 with app directory and src folder
* In development mode (yarn dev) it's working fine.
Thanks in advance.
SOLUTION: the NODE_ENV variable must have the value "production" and the error occurred when I tried to build with this variable as "development".
Answered by Spectacled bear
Hi joulev, nope, but the Kapa bot helped me to sole the problem. The NODE_ENV must be production to build the project, and when tried it, it worked!
Thanks.
Thanks.
7 Replies
Madeiran sardinella
Looks like next cannot compile some of your pages, try looking into them
Go to
Also it looks like you're adding
pages/_document and try removing <html>Also it looks like you're adding
<html> to pages outside of pages/_document which isn't possibleSpectacled bearOP
With app router there is no pages/document.tsx, but lauout.tsx, so the error is not valid, that's why I don't understand the reason for this error and why the _document.tsx is mentioned in it.
@Spectacled bear With app router there is no pages/document.tsx, but lauout.tsx, so the error is not valid, that's why I don't understand the reason for this error and why the _document.tsx is mentioned in it.
can you send us a github url to a reproduction repository?
Spectacled bearOP
Hi joulev, nope, but the Kapa bot helped me to sole the problem. The NODE_ENV must be production to build the project, and when tried it, it worked!
Thanks.
Thanks.
Answer
nice, glad you fixed it!