From 5d2e2783d780566a21b3142acdb8448f6b60d918 Mon Sep 17 00:00:00 2001 From: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Thu, 27 Oct 2022 14:33:38 -0700 Subject: [PATCH] fix(next/dev): do not suppress error from bindings (#41989) ## Bug Minor fix to --turbo to not to suppress errors thrown from bindings. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) --- packages/next/cli/next-dev.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/next/cli/next-dev.ts b/packages/next/cli/next-dev.ts index 7a5f882148eb6ca..12ea4388c7fe3b6 100755 --- a/packages/next/cli/next-dev.ts +++ b/packages/next/cli/next-dev.ts @@ -103,7 +103,7 @@ const nextDev: cliCommand = (argv) => { if (args['--turbo']) { // check for postcss, babelrc, swc plugins - return new Promise(async (resolve) => { + return new Promise(async (resolve) => { const { findConfigPath } = require('../lib/find-config') as typeof import('../lib/find-config') const { loadBindings } = @@ -260,7 +260,7 @@ If you cannot make the changes above, but still want to try out\nNext.js v13 wit } console.log(feedbackMessage) - loadBindings() + return loadBindings() .then((bindings: any) => { // eslint-disable-next-line no-shadow const findUp = @@ -286,7 +286,14 @@ If you cannot make the changes above, but still want to try out\nNext.js v13 wit preflight().catch(() => {}) return server }) - .then(resolve) + .then( + () => { + resolve() + }, + (err: Error) => { + console.error(err) + } + ) }) } else { startServer(devServerOptions)