New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
next build command fails with some inner error #12717
Comments
UpdateThe error is not a NextJS bug but rather a special case for which reporting can be improved. I handle the same object at
Which causes the above conflict. I'll leave it up to you guys how to treat such cases. |
Update-2There are more bugs unfortunately. Added a demo here: https://github.com/ivan-kleshnin/buildbug It demonstrates another, even more fundamental bug. Unless I'm doing something wrong. |
Also running into this issue:
In const pages = await ...
const paths = pages.results
.filter((page) => {
return page.uid !== 'index'
})
.map((page) => ({
params: { uid: page.uid },
}))
return {
paths,
fallback: true,
} |
Closing as stale. Please let us know if this still reproduces. |
I got this error on |
I'm having this issue as well on 10.0.1 |
1 similar comment
I'm having this issue as well on 10.0.1 |
This comment has been minimized.
This comment has been minimized.
@amykapernick Are you using dynamic routes? In my case, I had a page Hope it helps :-) |
@robbertvancaem I am and I did, but that made no difference. I also had several other pages which had separate page files, whilst also meeting a |
Seeing this on The @Timer can this issue be re-opened? |
Oh, looks like there's already a fix merged into |
This recently happened to me and it turned out I was accidentally building a page twice (via multiple spots where there are dynamic routes) and next.js emitted a similar error for the second instance the page would have been created because the file had already been copied over. |
I find this a pretty frustrating bug. I've had it come up a few times (and always have to resolve by filtering out dynamic paths), but the issue comes up where you are creating dynamic paths (like [blog]) and then make a static one that needs to be a snowflake for whatever reason. I actually had the build succeed locally, but fail when deployed to Vercel. So not sure what is happening there. It is a bug as far as I understand though, given the docs for next.js provide the caveat that "Predefined routes take precedence over dynamic routes, and dynamic routes over catch all routes". So it should just overwrite the files IMO. |
@andrewf414 can you create a new issue with a reproduction, we'd be happy to take a look. |
I ran into the same issue this morning. |
Maybe this helps someone: I ran into the same error message because I had |
I am running into this issue because I have a [storyId].js in the root of /pages. One of the story ids is Does anyone know if there is a way to change the built in 404 path to something else (i.e. change 404.html to 404-error.html). I searched the docs and did not find the answer (but could be missing it). I could nest 1 folder deeper to avoid the collision, but I am using a basepath of |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
$ next build
throws an error at optimization step:for
pages/blog/index.js
file with the followinggetStaticProps
It looks like some bug in NextJS build pipeline to me.
It started with recent NextJS and Now updates though I can't tell the particular breaking update at this moment. Can it be related to Now CLI 19.0.0? I dunno how to downgrade this tool to an earlier version.
Extra info:
getServerSideProps
or with purely static pages.$ next dev
.To Reproduce
I can make a sandbox if necessary.
Expected behavior
next build
should work 🤷System information
Notes
Besides trying different NextJS versions I tried
rm -rn node_modules
andyarn cache clean
.No effect on the bug.
The text was updated successfully, but these errors were encountered: