From 224523b2f3199daad02bb7a66e09f880432a10c6 Mon Sep 17 00:00:00 2001 From: Kara Brightwell Date: Fri, 6 Dec 2024 17:52:23 +0000 Subject: [PATCH 1/2] fix: correct logic for shouldDisableNativeFetch --- core/cli/src/fetch.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/cli/src/fetch.ts b/core/cli/src/fetch.ts index 3b0039036..30937ae2a 100644 --- a/core/cli/src/fetch.ts +++ b/core/cli/src/fetch.ts @@ -6,8 +6,5 @@ export const shouldDisableNativeFetch = (options: RootOptions): boolean => { // disable Node 18's native fetch if the Node runtime supports it (older // runtimes don't support the flag, implying they also don't use native // fetch) and the user hasn't opted out of the behaviour - return ( - options.allowNativeFetch && - process.allowedNodeEnvironmentFlags.has('--no-experimental-fetch') - ) + return !options.allowNativeFetch && process.allowedNodeEnvironmentFlags.has('--no-experimental-fetch') } From edf6443e2a07f07c325a3120ded600848d770fda Mon Sep 17 00:00:00 2001 From: Kara Brightwell Date: Fri, 6 Dec 2024 17:52:52 +0000 Subject: [PATCH 2/2] fix: don't append --no-experimental-fetch multiple times --- core/cli/src/tasks.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/cli/src/tasks.ts b/core/cli/src/tasks.ts index 8b014c90b..a9d08cdd8 100644 --- a/core/cli/src/tasks.ts +++ b/core/cli/src/tasks.ts @@ -65,7 +65,10 @@ export async function runTasksFromConfig( await runInit(logger, config) await checkInstall(logger, config) - if (shouldDisableNativeFetch(config.pluginOptions['app root'].options)) { + if ( + shouldDisableNativeFetch(config.pluginOptions['app root'].options) && + !process.execArgv.includes('--no-experimental-fetch') + ) { process.execArgv.push('--no-experimental-fetch') }