vercel/next.js · error
Warning: 'dev' is not a boolean which could introduce unexpe
Error message
Warning: 'dev' is not a boolean which could introduce unexpected behavior. https://nextjs.org/docs/messages/invalid-server-options
What it means
createServer validates its options: when the dev option is present but not a boolean (e.g. the string 'false', which is truthy), it warns that this could introduce unexpected behavior since truthiness checks will misinterpret the value.
Source
Thrown at packages/next/src/server/next.ts:673
) as unknown as NextWrapperServer
}
if (options == null) {
throw new Error(
'The server has not been instantiated properly. https://nextjs.org/docs/messages/invalid-server-options'
)
}
if (
!('isNextDevCommand' in options) &&
process.env.NODE_ENV &&
!['production', 'development', 'test'].includes(process.env.NODE_ENV)
) {
log.warn(NON_STANDARD_NODE_ENV)
}
if (options.dev && typeof options.dev !== 'boolean') {
console.warn(
"Warning: 'dev' is not a boolean which could introduce unexpected behavior. https://nextjs.org/docs/messages/invalid-server-options"
)
}
// When the caller is a custom server (using next()).
if (options.customServer !== false) {
const dir = path.resolve(/* turbopackIgnore: true */ options.dir || '.')
return new NextCustomServer({
...options,
dir,
})
}
// When the caller is Next.js internals (i.e. render worker, start server, etc)
return new NextServer(options)
}
View on GitHub (pinned to 0eb3775416)
Solutions
- Pass `dev` as a boolean in the Next.js server options.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/next/src/server/next.ts:673 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/1893eab9a7e7fcc0.
Report an issue: GitHub.