question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Github action production build fail at next build: since I updated to next v12

See original GitHub issue

Verify 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)

full log can be seen here: https://pipelines.actions.githubusercontent.com/serviceHosts/8895607a-933a-4321-87c1-d15f0bf230e6/_apis/pipelines/1/runs/159/signedlogcontent/2?urlExpires=2022-07-04T16%3A34%3A09.2242214Z&urlSigningMethod=HMACV1&urlSignature=nEpO0LP%2Finn6ch6mPcoVU4UzOSX2FY0XYurcBd3svkM%3D

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:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
beumskcommented, Jul 8, 2022

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-node

- uses: actions/setup-node@v3
        with:
          node-version: 14

Hope it fixes your issues as well!

0reactions
github-actions[bot]commented, Aug 13, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found