diff --git a/packages/nuxi/src/commands/dev.ts b/packages/nuxi/src/commands/dev.ts index 64d42e5cc..a66106b4c 100644 --- a/packages/nuxi/src/commands/dev.ts +++ b/packages/nuxi/src/commands/dev.ts @@ -14,6 +14,7 @@ import defu from 'defu' import { createJiti } from 'jiti' import { getArgs as getListhenArgs, parseArgs as parseListhenArgs } from 'listhen/cli' import { resolve } from 'pathe' +import { satisfies } from 'semver' import { isBun, isTest } from 'std-env' import { showVersions } from '../utils/banner' @@ -23,7 +24,7 @@ import { loadKit } from '../utils/kit' import { logger } from '../utils/logger' import { cwdArgs, dotEnvArgs, envNameArgs, legacyRootDirArgs, logLevelArgs } from './_shared' -const forkSupported = !isBun && !isTest +const forkSupported = !isTest && (!isBun || isBunForkSupported()) const command = defineCommand({ meta: { @@ -321,3 +322,8 @@ function _resolveListenOptions( baseURL: nuxtOptions.app.baseURL.startsWith('./') ? nuxtOptions.app.baseURL.slice(1) : nuxtOptions.app.baseURL, } } + +function isBunForkSupported() { + const bunVersion: string = (globalThis as any).Bun.version + return satisfies(bunVersion, '>=1.2') +}