[英]How to see errors on production mode - nuxtjs
Nuxt provides a flag to enable debugging on production in the nuxt.config.js
file Nuxt 在
nuxt.config.js
文件中提供了一个标志来启用生产调试
{
debug: true
}
You should be able the see the server logs from terminal you started the server(npm run start / nuxt start etc.).您应该能够从您启动服务器的终端查看服务器日志(npm run start / nuxt start 等)。 If you want the dev console in production mode, add this to your nuxt.config.js
如果您希望开发控制台处于生产模式,请将其添加到您的 nuxt.config.js
build: {
terser:{
terserOptions: {
compress:{
drop_console: false,
},
},
},
},
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.否则,在整个测试 CI 之上, Sentry / Logrocket是很好的解决方案。
A staging URL replicating the production environment is also a viable solution.复制生产环境的暂存 URL 也是一种可行的解决方案。
Otherwise, you should not have publicly visible logs accessible from the public.否则,您不应该让公众可以访问公开可见的日志。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.