next.js: v13.3.0 getStaticPaths Fails with error - Error: Call retries were exceeded

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000
    Binaries:
      Node: 19.8.1
      npm: 9.5.1
      Yarn: N/A
      pnpm: N/A
    Relevant packages:
      next: 13.3.1-canary.0
      eslint-config-next: 13.2.4
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

https://github.com/vercel/next.js/

To Reproduce

export const getStaticPaths: GetStaticPaths = async () => {
    const mySlugs = await getMySlugs(); // returns a array of ~2500 strings 

    var paths = mySlugs.map(s => {
      return {
        params: { slug: s }
      };
    })

    var res = { paths: paths, fallback: false };
    return res;
}

Describe the Bug

The get request await getMySlugs(); to get my slugs works fine, but I Get this error:

error - Error: Call retries were exceeded
    at ChildProcessWorker.initialize (/Users/re/abc/my-proj/node_modules/next/dist/compiled/jest-worker/index.js:1:11661)
    at ChildProcessWorker._onExit (/Users/re/abc/my-proj/node_modules/next/dist/compiled/jest-worker/index.js:1:12599)
    at ChildProcess.emit (node:events:512:28)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12) {
  digest: undefined
}

Expected Behavior

getStaticPaths should not throw an error because await getMySlugs(); returns fine. I should see the page available. It works in 12.5.4

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 24
  • Comments: 16 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Seems to be fixed for me in release 13.3.1 thank you ijjk!

I’m on 13.4.5, same issue for me. Any updates with this?

If anyone wants to use 13.3.0 but can’t wait for Vercel to work on this issue, here’s a patch I’ve made using patch-package: patches.zip

How to patch:

  1. Extract the archive at the root of your project (should create a patches folder)
  2. Install patch-package: npm i patch-package
  3. In package.json add the postinstall script:
     "scripts": {
    +  "postinstall": "patch-package"
     }
    
  4. Rerun npm i to trigger the postinstall script. You should see the patch being applied in the console:
    Applying patches...
    next@13.3.0 ✔
    

If you’re curious what the patch is all about, it’s just reverting the changing made to packages/next/src/server/dev/static-paths-worker.ts (see my previous message above). You can create the patch yourself by:

  1. installing Next v13.2.4
  2. copying packages/next/src/server/dev/static-paths-worker.ts
  3. installing Next v13.3.0 and replacing packages/next/src/server/dev/static-paths-worker.ts with the copied version.
  4. Install patch-package: npm i patch-package
  5. In package.json add the postinstall script:
     "scripts": {
    +  "postinstall": "patch-package"
     }
    
  6. Create a patch using: npx patch-package next
  7. The patch is now created in the patches folder at the root of your project.

Same issue here with 13.3.0

error - Error: Call retries were exceeded
    at ChildProcessWorker.initialize (node_modules/next/dist/compiled/jest-worker/index.js:1:11661)
    at ChildProcessWorker._onExit (node_modules/next/dist/compiled/jest-worker/index.js:1:12599)
    at ChildProcess.emit (node:events:512:28)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12) {
  digest: undefined

Same problem here after upgrading from 13.2.4 to 13.3.0

Edit: After further experimentation, I start reproducing the problem from version 13.2.5-canary.24, canary.23 was working as expected.

Edit 2: I believe this bug is related to #47716 that was merged on canary.24. After patching 13.3.0 by reverting the changes made to packages/next/src/server/dev/static-paths-worker.ts, everything is working fine again.

I upgraded my next version from 12.1.0 to 13.3.0 and started to get this error.

I’m getting the same error as @j4p3. Tested on next==13.2.3 and next==13.4.4. I didn’t change anything, the dev server seems to have spontaneously decided to stop working