File tree 1 file changed +14
-11
lines changed
1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -189,21 +189,24 @@ export default class NextNodeServer extends BaseServer<
189
189
// Initialize super class
190
190
super ( options )
191
191
192
+ const isDev = options . dev ?? false
193
+ this . isDev = isDev
194
+ this . sriEnabled = Boolean ( options . conf . experimental ?. sri ?. algorithm )
195
+
192
196
const isTurbopackBuild = this . isTurbopackBuild ( )
193
197
194
- if ( process . env . TURBOPACK && ! isTurbopackBuild ) {
195
- throw new Error (
196
- `Invariant: --turbopack is set but the build used Webpack`
197
- )
198
- } else if ( ! process . env . TURBOPACK && isTurbopackBuild ) {
199
- throw new Error (
200
- `Invariant: --turbopack is not set but the build used Turbopack. Add --turbopack to "next start".`
201
- )
198
+ if ( ! isDev ) {
199
+ if ( process . env . TURBOPACK && ! isTurbopackBuild ) {
200
+ throw new Error (
201
+ `Invariant: --turbopack is set but the build used Webpack`
202
+ )
203
+ } else if ( ! process . env . TURBOPACK && isTurbopackBuild ) {
204
+ throw new Error (
205
+ `Invariant: --turbopack is not set but the build used Turbopack. Add --turbopack to "next start".`
206
+ )
207
+ }
202
208
}
203
209
204
- this . isDev = options . dev ?? false
205
- this . sriEnabled = Boolean ( options . conf . experimental ?. sri ?. algorithm )
206
-
207
210
/**
208
211
* This sets environment variable to be used at the time of SSR by head.tsx.
209
212
* Using this from process.env allows targeting SSR by calling
You can’t perform that action at this time.
0 commit comments