diff --git a/packages/nuxt/src/app/plugins/payload.client.ts b/packages/nuxt/src/app/plugins/payload.client.ts index f418f48ad01..fb9d4c3ad03 100644 --- a/packages/nuxt/src/app/plugins/payload.client.ts +++ b/packages/nuxt/src/app/plugins/payload.client.ts @@ -2,7 +2,7 @@ import { defineNuxtPlugin, loadPayload, addRouteMiddleware, isPrerendered } from export default defineNuxtPlugin((nuxtApp) => { // Only enable behavior if initial page is prerendered - // TOOD: Support hybrid + // TOOD: Support hybrid and dev if (!isPrerendered()) { return } diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 419650e227c..d5cb7da8c7a 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -174,7 +174,9 @@ async function initNuxt (nuxt: Nuxt) { }) // Add prerender payload support - addPlugin(resolve(nuxt.options.appDir, 'plugins/payload.client')) + if (!nuxt.options.dev) { + addPlugin(resolve(nuxt.options.appDir, 'plugins/payload.client')) + } // Track components used to render for webpack if (nuxt.options.builder === '@nuxt/webpack-builder') {