From 1ed33872433bc0d4d370fa8a9b35833793ee4bdb Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 18 Jun 2021 14:34:07 +0200 Subject: [PATCH] fix: use nitro plugin with explicit mjs extension --- .../nitro/src/runtime/app/{nitro.client.js => nitro.client.mjs} | 0 packages/nuxt3/src/nitro.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/nitro/src/runtime/app/{nitro.client.js => nitro.client.mjs} (100%) diff --git a/packages/nitro/src/runtime/app/nitro.client.js b/packages/nitro/src/runtime/app/nitro.client.mjs similarity index 100% rename from packages/nitro/src/runtime/app/nitro.client.js rename to packages/nitro/src/runtime/app/nitro.client.mjs diff --git a/packages/nuxt3/src/nitro.ts b/packages/nuxt3/src/nitro.ts index cdb98ba4a9..a93c9ba0c8 100644 --- a/packages/nuxt3/src/nitro.ts +++ b/packages/nuxt3/src/nitro.ts @@ -22,7 +22,7 @@ export function initNitro (nuxt: Nuxt) { // Add nitro client plugin (to inject $fetch helper) nuxt.hook('app:resolve', (app) => { - app.plugins.push({ src: '@nuxt/nitro/dist/runtime/app/nitro.client' }) + app.plugins.push({ src: require.resolve('@nuxt/nitro/dist/runtime/app/nitro.client.mjs') }) }) // Expose process.env.NITRO_PRESET