Skip to content

Commit 1784ddd

Browse files
committed
Update error message
1 parent 9feaa0d commit 1784ddd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/next/errors.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -666,5 +666,7 @@
666666
"665": "Failed to find Server Action \"%s\". This request might be from an older or newer deployment.\\nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action",
667667
"666": "Turbopack builds are only available in canary builds of Next.js.",
668668
"667": "receiveExpiredTags is deprecated, and not expected to be called.",
669-
"668": "Internal Next.js error: Router action dispatched before initialization."
669+
"668": "Internal Next.js error: Router action dispatched before initialization.",
670+
"669": "Invariant: --turbopack is set but the build used Webpack",
671+
"670": "Invariant: --turbopack is not set but the build used Turbopack. Add --turbopack to \"next start\"."
670672
}

packages/next/src/server/next-server.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ export default class NextNodeServer extends BaseServer<
193193

194194
if (process.env.TURBOPACK && !isTurbopackBuild) {
195195
throw new Error(
196-
`Invariant: --turbopack is set but the build is not a Turbopack build`
196+
`Invariant: --turbopack is set but the build used Webpack`
197197
)
198198
} else if (!process.env.TURBOPACK && isTurbopackBuild) {
199199
throw new Error(
200-
`Invariant: --turbopack is not set but the build is a Turbopack build`
200+
`Invariant: --turbopack is not set but the build used Turbopack. Add --turbopack to "next start".`
201201
)
202202
}
203203

0 commit comments

Comments
 (0)