Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nuxt] Cannot load payload /_payload.json #22068

Closed
Timtendo12 opened this issue Jul 10, 2023 · 18 comments · Fixed by #22162
Closed

[nuxt] Cannot load payload /_payload.json #22068

Timtendo12 opened this issue Jul 10, 2023 · 18 comments · Fixed by #22162

Comments

@Timtendo12
Copy link

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
@GitRowin
Copy link

I ran into the same issue. It works fine in Nuxt version 3.6.1. I think it's caused by this PR: #21860

@danielroe
Copy link
Member

You can probably work around this by adding:

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

This should be properly resolved with #21370.

Other context: #15024.

@Timtendo12
Copy link
Author

Timtendo12 commented Jul 10, 2023

This did fix the warning message, but it did not fix the navigation issue. I still get redirected back to "/". It seems like this only applies to routes with multiple childeren. Normal routes without childeren works or routes with only 1 child works fine.

@danielroe
Copy link
Member

In that case, would you provide a reproduction? 🙏

@danielroe
Copy link
Member

possibly same issue as #22072

@mschoeffmann
Copy link

possibly same issue as #22072

at least the workaround (experimental.payloadExtraction: false) did not work for #22072

@dammitjim
Copy link

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

Downgrade to 3.6.1 fixed it for me.

@JonathanDoelan
Copy link

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
  }
})

@toniengelhardt
Copy link
Contributor

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
  }
})

That fixes it for me 🙏🏽

@danielroe
Copy link
Member

Would you try with the latest v3.6.3?

@toniengelhardt
Copy link
Contributor

Would you try with the latest v3.6.3?

Had the issue with v3.6.3

@Gonzalo-Bruna
Copy link

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
  }
})

This fixed it for me too! thanks a lot!

@manniL
Copy link
Member

manniL commented Jul 15, 2023

I think the problem is that after #21860, process.env.NUXT_PAYLOAD_EXTRACTION is not set correctly anymore as the override from the PR comes "too late".

@javokhirbekkhaydarov
Copy link

javokhirbekkhaydarov commented Aug 28, 2023

Cannot load payload in Nuxt 3.6.5
I wrote

mounted() {
store.dispatch("products/getProductsByCategoryId", this.$route.params.id);
},

it is return this warn
image

here my nuxt.config.ts but when i refresh page server return 404 

export default defineNuxtConfig({   

experimental: {
payloadExtraction: false
},
nitro: {
inlineDynamicImports: true
}});

I'm trying to fix it , still not solve this error

@niko-chaffinchicas
Copy link

@JonathanDoelan Thank you for the workaround. This worked to get nuxt generate outputting a static site that can be deployed to gh-pages with no errors (Nuxt 3.7.4). 🙌

@manniL
Copy link
Member

manniL commented Oct 8, 2023

@JonathanDoelan Thank you for the workaround. This worked to get nuxt generate outputting a static site that can be deployed to gh-pages with no errors (Nuxt 3.7.4). 🙌

When using nuxt generate, payload extraction should be set automatically (if unset) 😋

@JonathanDoelan
Copy link

JonathanDoelan commented Oct 8, 2023

My workaround is not necessary any more since v3.6.3

@niko-chaffinchicas
Copy link

When using nuxt generate, payload extraction should be set automatically (if unset) 😋

@manniL Oh interesting, I'll have to look into the docs and maybe the source code more regarding that, I guess. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.