S.M_Emamian
S.M_Emamian

Reputation: 17383

How to see errors on production mode - nuxtjs

I think there are many questions about this. But there isn't a correct answer. How I can see detail of error logs on production mode?

enter image description here

Upvotes: 3

Views: 6537

Answers (3)

Nguyen Phai
Nguyen Phai

Reputation: 102

Nuxt provides a flag to enable debugging on production in the nuxt.config.js file

{
  debug: true
}

Upvotes: 5

kissu
kissu

Reputation: 46604

You should debug it locally before shipping to production because this may be fixable locally.
Otherwise, Sentry/Logrocket are good solutions, on top of a whole testing CI.
A staging URL replicating the production environment is also a viable solution.

Otherwise, you should not have publicly visible logs accessible from the public.

Upvotes: 2

mokumus
mokumus

Reputation: 320

You should be able the see the server logs from terminal you started the server(npm run start / nuxt start etc.). If you want the dev console in production mode, add this to your nuxt.config.js

  build: {
    terser:{
      terserOptions: {
        compress:{
          drop_console: false,
        },
      },
    },
  },

Upvotes: 0

Related Questions