Skip to content

Commit

Permalink
Revert "Fix debugging in napi for next-api"
Browse files Browse the repository at this point in the history
This reverts commit d07a478.
  • Loading branch information
jridgewell committed Aug 11, 2023
1 parent 605d21c commit efd9ce0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
15 changes: 0 additions & 15 deletions packages/next/src/build/swc/index.ts
Expand Up @@ -191,21 +191,6 @@ export async function loadBindings(): Promise<Binding> {
if (pendingBindings) {
return pendingBindings
}

if (process.platform === 'darwin') {
// 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
// see https://github.com/napi-rs/napi-rs/issues/1630
// and https://github.com/nodejs/node/blob/main/doc/api/process.md#a-note-on-process-io
if (process.stdout._handle != null) {
// @ts-ignore
process.stdout._handle.setBlocking(true)
}
if (process.stderr._handle != null) {
// @ts-ignore
process.stderr._handle.setBlocking(true)
}
}

const isCustomTurbopack = await __isCustomTurbopackBinary()
pendingBindings = new Promise(async (resolve, _reject) => {
if (!lockfilePatchPromise.cur) {
Expand Down
14 changes: 14 additions & 0 deletions packages/next/src/cli/next-dev.ts
Expand Up @@ -274,6 +274,20 @@ const nextDev: CliCommand = async (argv) => {
)
}

if (process.platform === 'darwin') {
// 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
// see https://github.com/napi-rs/napi-rs/issues/1630
// and https://github.com/nodejs/node/blob/main/doc/api/process.md#a-note-on-process-io
if (process.stdout._handle != null) {
// @ts-ignore
process.stdout._handle.setBlocking(true)
}
if (process.stderr._handle != null) {
// @ts-ignore
process.stderr._handle.setBlocking(true)
}
}

// Turbopack need to be in control over reading the .env files and watching them.
// So we need to start with a initial env to know which env vars are coming from the user.
resetEnv()
Expand Down

0 comments on commit efd9ce0

Please sign in to comment.