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

useCsrfFetch is not working after running "npm run build" in production #583

Open
raliclo opened this issue Dec 4, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@raliclo
Copy link

raliclo commented Dec 4, 2024

Environment

Nuxt project info:                                                                                       
------------------------------
- Operating System: Windows_NT
- Node Version:     v23.0.0
- Nuxt Version:     3.14.1592
- CLI Version:      3.16.0
- Nitro Version:    2.10.4
- Package Manager:  [email protected]
- Builder:          -
- User Config:      default
- Runtime Modules:  [email protected], @primevue/[email protected], @pinia/[email protected]
- Build Modules:    -
------------------------------

Nuxt Security Version

v2.1.5

Default setup used?

Yes, the bug happens even if the security option is not customized

Security options

security: {
    csrf: true,
    headers: {
      xXSSProtection: '0'
    },
    rateLimiter: {
      tokensPerInterval: 5,
      interval: 30000,
      headers: true
    },
  },

Reproduction

Github:
https://github.com/raliclo/Nuxt_Security_PrimeVue_Pinia

Bug page
http://localhost:3000/about

Description

Bug page
http://localhost:3000/about

-What happens ?
When I use "npm run dev" to view the bug page, the {{time}} called by nuxt server api is successfuly rendered.
But if I use "npm run build" and run production version. The api call was not called.
It seems to be "useCsrfFetch" not calling the nuxt server api in the production page.

-What is expected to happen ?
useCsrfFetch is working and the about page call the nuxt server api.

Additional context

No response

Logs

@raliclo raliclo added the bug Something isn't working label Dec 4, 2024
@Baroshem
Copy link
Collaborator

Baroshem commented Dec 4, 2024

@Morgbn

Would you be able to help here? :)

@OTTIN-T
Copy link

OTTIN-T commented Dec 21, 2024

I have the same problem. I suppose it's linked to this #bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants