Skip to content

Commit

Permalink
test(next-dev): hard fail if next-dev runs with turbopack intenral flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jun 14, 2023
1 parent 86112a3 commit dbe5998
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/next/src/cli/next-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ const nextDev: CliCommand = async (argv) => {
} else {
let cleanupFns: (() => Promise<void> | void)[] = []
const runDevServer = async () => {
if (process.env.__INTERNAL_NEXT_DEV_TEST_TURBO_DEV) {
require('console').error(
`[ERROR]: Incorrect mode: turbopack test mode is force enabled, shouldn't run dev server`
)
process.exit(1)
}
const oldCleanupFns = cleanupFns
cleanupFns = []
await Promise.allSettled(oldCleanupFns.map((fn) => fn()))
Expand Down

0 comments on commit dbe5998

Please sign in to comment.