Skip to content

Commit

Permalink
Disable worker_threads by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Oct 28, 2019
1 parent 6d30574 commit d0979f3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
9 changes: 0 additions & 9 deletions examples/with-firebase-authentication/next.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default class TaskRunner {

if (this.maxConcurrentWorkers > 1) {
this.workers = new Worker(worker, {
numWorkers: this.maxConcurrentWorkers,
enableWorkerThreads: true,
numWorkers: this.maxConcurrentWorkers,
})
this.boundWorkers = options => this.workers.default(options)
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/next-server/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const defaultConfig: { [key: string]: any } = {
publicDirectory: false,
sprFlushToDisk: true,
deferScripts: false,
workerThreads: true,
workerThreads: false,
},
future: {
excludeDefaultMomentLocales: false,
Expand Down
11 changes: 5 additions & 6 deletions test/integration/firebase-grpc/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const nextConfig = path.join(appDir, 'next.config.js')

describe('Builds with firebase dependency only sequentially', () => {
it('Throws an error when building with firebase dependency with worker_threads', async () => {
await fs.remove(nextConfig)
await fs.writeFile(
nextConfig,
`module.exports = { experimental: { workerThreads: true } }`
)
const results = await nextBuild(appDir, [], { stdout: true, stderr: true })
expect(results.stdout + results.stderr).toMatch(/Build error occurred/)
expect(results.stdout + results.stderr).toMatch(
Expand All @@ -19,12 +22,8 @@ describe('Builds with firebase dependency only sequentially', () => {
})

it('Throws no error when building with firebase dependency without worker_threads', async () => {
await fs.writeFile(
nextConfig,
`module.exports = { experimental: { workerThreads: false } }`
)
const results = await nextBuild(appDir, [], { stdout: true, stderr: true })
await fs.remove(nextConfig)
const results = await nextBuild(appDir, [], { stdout: true, stderr: true })
expect(results.stdout + results.stderr).not.toMatch(/Build error occurred/)
expect(results.stdout + results.stderr).not.toMatch(
/grpc_node\.node\. Module did not self-register\./
Expand Down

0 comments on commit d0979f3

Please sign in to comment.