nuxt: [nuxt] Cannot load payload /_payload.json

Environment


  • Operating System: Windows_NT
  • Node Version: v18.16.0
  • Nuxt Version: 3.6.2
  • Nitro Version: 2.5.2
  • Package Manager: npm@9.8.0
  • Builder: vite
  • User Config: pages, debug, dev, modules, pwa, app, vue, ignore
  • Runtime Modules: @nuxt/devtools@0.2.5
  • Build Modules: -

Reproduction

its a pretty big project, It always worked fine and all I did before this happened was running npm install

Describe the bug

When using my nuxt site using a different domain navigating to other pages stops working

when I build my site and upload it to azure it comes available on multiple domains

  1. the azure domain (Site works fine here)
  2. Our domain with a special subdomain (usually its help.domain.app)

On our subdomain the website navigation stops working and spits out the following error: image

Additional context

No response

Logs

build logs
https://hastebin.com/share/oyamipasuv.bash

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 5
  • Comments: 18 (8 by maintainers)

Most upvoted comments

What I’ve found out is that since v3.6.2 we need to explicitly set experimental.payloadExtraction to true. Otherwise the _payload.json files are not generated (in SSG mode).

export default defineNuxtConfig({
  experimental: {
    payloadExtraction: true
  }
})

Would you try with the latest v3.6.3?

Had the issue with v3.6.3

I think the problem is that after https://github.com/nuxt/nuxt/pull/21860, process.env.NUXT_PAYLOAD_EXTRACTION is not set correctly anymore as the override from the PR comes “too late”.

Experienced this when attempting to deploy a fully static site with payload extraction.

Downgrade to 3.6.1 fixed it for me.

You can probably work around this by adding:

export default defineNuxtConfig({
  experimental: {
    payloadExtraction: false
  }
})

This should be properly resolved with https://github.com/nuxt/nuxt/issues/21370.

Other context: https://github.com/nuxt/nuxt/issues/15024.