Github action production build fail at next build: since I updated to next v12
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Github actions env Environment: ubuntu-20.04 Version: 20220626.1 next@12
What browser are you using? (if relevant)
NA
How are you deploying your application? (if relevant)
Github action
Describe the Bug
Since I switched from v11 to v12 I can’t get my nextjs site deployed with github actions. I receive this weird error that I dont get with yarn dev or yarn start locally:
/home/runner/work/beumsk.github.io/beumsk.github.io/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js:7
placeholder = true;
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/runner/work/beumsk.github.io/beumsk.github.io/node_modules/next/dist/shared/lib/router/utils/index.js:17:21)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
and my repo: https://github.com/beumsk/beumsk.github.io
I searched here and online without success. Can anyone help me or at least point me in the right direction?
Thank you so much already 😃
Expected Behavior
The production build should work as it does in my local env.
Link to reproduction
na
To Reproduce
I don’t know how I can make it possible to reproduce.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Stuck on Creating an optimized production build forever when ...
I am trying to update to nextjs v12.3.2 and using antd 4.23.6. In the next.config.js file under webpack config I had this block:...
Read more >Github Action production build fail at 'Creating an optimized ...
While this error happens in Github actions, there is not a single error in my local env when I run the next build...
Read more >next build wont work after updating from next@9.5.3 ... - GitHub
Bug report Describe the bug The command next build fails on next@9.5.4 but works fine in next@9.5.3. The error log is the following:...
Read more >Failed to build on GitHub Actions with Next.js 12.3 #40831
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar...
Read more >issue: build fails on nextjs v12, something to with yup ... - GitHub
Run next lint to begin setup info - Creating an optimized production build info - Compiled successfully > Build error occurred ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, switching to Nextjs v12 needs a more recent version of Node, which you have to explicitly choose in your
integrate.yml
. Here is the way to specify it to node 14 for example, as you can read here: https://github.com/actions/setup-nodeHope it fixes your issues as well!
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.