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

routeRules are undefined in production #26567

Closed
mikeCrafted opened this issue Mar 29, 2024 · 6 comments
Closed

routeRules are undefined in production #26567

mikeCrafted opened this issue Mar 29, 2024 · 6 comments

Comments

@mikeCrafted
Copy link

Environment


  • Operating System: Windows_NT
  • Node Version: v21.6.1
  • Nuxt Version: 3.11.1
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.5
  • Package Manager: npm@9.6.4
  • Builder: -
  • User Config: runtimeConfig, sourcemap, vite, app, css, modules, i18n, alias, auth, build, site, schemaOrg, ogImage, sitemap, devtools
  • Runtime Modules: @sidebase/nuxt-auth@0.6.7, @nuxtjs/i18n@8.2.0, @pinia/nuxt@0.5.1, nuxt3-leaflet@1.0.12, @nuxtjs/seo@2.0.0-rc.10
  • Build Modules: -

Reproduction

Indeterministic behavior only in production build on Azure app service :(
following routeRules are in nuxt.config:
routeRules: { '/jobs': { redirect: '/karriere' } }

Describe the bug

App crashes on load with this error:
image
Never had this in dev or local build, error occurs only for some users - not on any of my machines, which makes it difficult to track down for the cause.

Additional context

No response

Logs

No response

@tobiasdiez
Copy link
Contributor

I experience a similar but slightly different issue. Upon upgrading from nuxt 3.10.3 all routes defined in nuxt.config as well as all pages except for the index are resulting in 404 errors when deployed to azure functions. Strangely, also the server routes are working correctly (in my case /api). I cannot reproduce it locally with the azure cli, and running the dev server locally also works. No errors are logged in the azure portal. Hence, I have no idea how to investigate this issue further. @mikeCrafted did you found a temporary workaround?

Not sure if I its worth opening another issue for the problem I'm seeing.

@mikeCrafted
Copy link
Author

@tobiasdiez no, nothing so far. Keep getting this error every now and then, probably once per day. Still can't reproduce it though.

@tobiasdiez
Copy link
Contributor

Thanks. For me downgrading nitro to 2.8.1 worked. Not sure if you see exactly the same error, so not sure if this is a solution for you as well. I've opened unjs/nitro#2342 to track this at the source.

@markthree
Copy link

markthree commented Apr 6, 2024

@tobiasdiez @mikeCrafted I think it's a problem with ofetch, try this module to fix it for now → markthree/nuxt-fix-ofetch

Copy link
Contributor

github-actions bot commented Apr 6, 2024

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
👉 https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

@danielroe
Copy link
Member

let's track upstream in unjs/nitro#2342 - this is unlikely to be a nuxt issue and is more likely to be a nitro one... a minimal reproduction would be helpful there though, if possible

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants