Website not working on prod, no useful errors.
I simply get this error, it works fine in dev mode, or preview mode on my machine. Would be useful to know how to get more detailed errors. Nothing in the logs (server side) and nothing in the client console. At this point I'm not sure where this goes wrong.

6 Replies
Hi @Kyllian. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, it seems you're encountering a common issue with Nuxt 3 in production where you're seeing a generic 500 error without detailed information. This can be frustrating to debug, but there are a few steps you can take to get more information and potentially resolve the issue:
1. Enable debug mode:
You can enable debug mode in your Nuxt configuration to get more detailed logs. As mentioned in the Nuxt Configuration documentation, set
debug: true
in your nuxt.config.ts
file. This will print out hook names and timings on the server, and log hook arguments in the browser.
2. Check for environment variables:
As noted in a comment on a GitHub issue, versions above 3.0.0 of Nuxt 3 require certain environment variables. Make sure all necessary environment variables are set on your production server. This is especially important for things like session management and authentication. You can refer to the Nuxt documentation on sessions and authentication for more details.
3. Investigate server-side errors:
If the error is occurring on the server side, you might be able to get more information by checking your server logs. The exact location of these logs will depend on your hosting setup.
4. Use the nuxi analyze
command:
As described in the Nuxt CLI documentation, you can use the nuxi analyze
command to analyze your production bundle. This might help identify any issues with your build.
5. Check for CDN issues:
If you're using a CDN like Cloudflare, make sure it's not interfering with your application. The Nuxt deployment documentation mentions some settings that should be disabled in Cloudflare to prevent issues.
6. Investigate specific page issues:
If the error is occurring on a specific page, try to isolate what's unique about that page. Are you using any specific components or data fetching methods on that page?
7. Check for build errors:
Make sure your production build is completing successfully without any errors.
If none of these steps help, you might need to provide more specific information about your setup and the exact steps to reproduce the error. The Nuxt community is generally very helpful with debugging these kinds of issues.
Remember, the key to solving production issues is often getting more detailed error information. Once you have that, the path to a solution usually becomes clearer.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@166602211780984832> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
page:loading:start
DbM7oId9.js:34 app:created
DbM7oId9.js:34 app:beforeMount
DbM7oId9.js:34 vue:setup
DbM7oId9.js:34 app:mounted
DbM7oId9.js:34 app:suspense:resolve
this is the most information im getting from the client side
this is about all I get in my server logs

try to log e.g. via nitro error hooks
i acutally figured it out, it was a dependency i was using. it uses Axios to do some requests. It was adding an extra
/
within the path of the URL. Fixed it by cloning the package, and removing this double /
very interesting it only happens on prod builds though