rsnext/packages
Sukka b132efc5c4
fix(export): make static export work with worker_threads (#47784)
Fixes #46993.

The issue is introduced in #46705 by @ijjk 

Next.js uses `jest-worker` for multiprocessing. `jest-worker` supports both `child_process` and `worker_threads` modes. Next.js use `child_process` mode by default, but can also switch to using `worker_threads` mode with an experimental flag `config.experimental.workerThreads`.

In #46705, @ijjk applies a fix that works for the `child_process` mode, which breaks the `worker_threads` mode (`jest-worker`'s `NodeThreadWorker` interface doesn't have the private property `_child`), causing static HTML export to fail with the following error (#46993):

```
> Build error occurred
TypeError: Cannot read properties of undefined (reading 'on')
    at createWorker (/Users/[redacted]/node_modules/next/dist/lib/worker.js:32:31)
    at new Worker (/Users/[redacted]/node_modules/next/dist/lib/worker.js:42:9)
    at /Users/[redacted]/node_modules/next/dist/build/index.js:629:35
    at async Span.traceAsyncFn (/Users/[redacted]/node_modules/next/dist/trace/trace.js:79:20)
    at async Object.build [as default] (/Users/[redacted]/node_modules/next/dist/build/index.js:74:29)
```

The PR fixes that.
2023-04-01 17:43:59 +00:00
..
create-next-app v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
eslint-config-next v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
eslint-plugin-next v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
font v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
next fix(export): make static export work with worker_threads (#47784) 2023-04-01 17:43:59 +00:00
next-bundle-analyzer v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
next-codemod v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
next-env v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
next-mdx v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
next-plugin-storybook v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
next-polyfill-module v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
next-polyfill-nomodule v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
next-swc Turbopack: Use SharedError for body streaming (#47677) 2023-04-01 11:37:17 +00:00
react-dev-overlay v13.2.5-canary.25 2023-04-01 03:32:33 +00:00
react-refresh-utils v13.2.5-canary.25 2023-04-01 03:32:33 +00:00