Skip to content

Commit 7f166d8

Browse files
committed
Revert "Fix debugging in napi for next-api"
This reverts commit d07a478.
1 parent a70b57f commit 7f166d8

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

packages/next/src/build/swc/index.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,6 @@ export async function loadBindings(): Promise<Binding> {
191191
if (pendingBindings) {
192192
return pendingBindings
193193
}
194-
195-
if (process.platform === 'darwin') {
196-
// rust needs stdout to be blocking, otherwise it will throw an error (on macOS at least) when writing a lot of data (logs) to it
197-
// see https://github.com/napi-rs/napi-rs/issues/1630
198-
// and https://github.com/nodejs/node/blob/main/doc/api/process.md#a-note-on-process-io
199-
if (process.stdout._handle != null) {
200-
// @ts-ignore
201-
process.stdout._handle.setBlocking(true)
202-
}
203-
if (process.stderr._handle != null) {
204-
// @ts-ignore
205-
process.stderr._handle.setBlocking(true)
206-
}
207-
}
208-
209194
const isCustomTurbopack = await __isCustomTurbopackBinary()
210195
pendingBindings = new Promise(async (resolve, _reject) => {
211196
if (!lockfilePatchPromise.cur) {

packages/next/src/cli/next-dev.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,20 @@ const nextDev: CliCommand = async (argv) => {
342342
)
343343
}
344344

345+
if (process.platform === 'darwin') {
346+
// rust needs stdout to be blocking, otherwise it will throw an error (on macOS at least) when writing a lot of data (logs) to it
347+
// see https://github.com/napi-rs/napi-rs/issues/1630
348+
// and https://github.com/nodejs/node/blob/main/doc/api/process.md#a-note-on-process-io
349+
if (process.stdout._handle != null) {
350+
// @ts-ignore
351+
process.stdout._handle.setBlocking(true)
352+
}
353+
if (process.stderr._handle != null) {
354+
// @ts-ignore
355+
process.stderr._handle.setBlocking(true)
356+
}
357+
}
358+
345359
// Turbopack need to be in control over reading the .env files and watching them.
346360
// So we need to start with a initial env to know which env vars are coming from the user.
347361
resetEnv()

0 commit comments

Comments
 (0)