diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 20e690da37..0e8da6bf9a 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -137,7 +137,7 @@ export default class Builder extends Tapable { options: this.options, uniqBy: _.uniqBy, isDev: this.options.dev, - debug: this.options.render.debug, + debug: this.options.debug, router: this.options.router, env: this.options.env, head: this.options.head, diff --git a/lib/common/options.js b/lib/common/options.js index 3a33275a95..d0b7042c59 100755 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -49,8 +49,8 @@ export default function Options (_options) { } // Debug errors - if (options.render.debug === undefined) { - options.render.debug = options.dev + if (options.debug === undefined) { + options.debug = options.dev } // Resolve mode @@ -98,6 +98,7 @@ Options.modes = { Options.defaults = { mode: 'universal', dev: process.env.NODE_ENV !== 'production', + debug: undefined, // Will be equal to dev if not provided buildDir: '.nuxt', nuxtAppDir: resolve(__dirname, '../lib/app/'), // Relative to dist build: { @@ -188,7 +189,6 @@ Options.defaults = { bundleRenderer: {}, resourceHints: true, ssr: undefined, - debug: undefined, // Will be set equal to dev http2: { push: false }, diff --git a/lib/core/renderer.js b/lib/core/renderer.js index 9b40662f6a..afdef80f14 100644 --- a/lib/core/renderer.js +++ b/lib/core/renderer.js @@ -286,7 +286,7 @@ export default class Renderer extends Tapable { const sendResponse = (content, type = 'text/html') => { // Set Headers res.statusCode = err.statusCode - res.statusMessage = this.options.render.debug ? err.message : err.name + res.statusMessage = this.options.debug ? err.message : err.name res.setHeader('Content-Type', type + '; charset=utf-8') res.setHeader('Content-Length', Buffer.byteLength(content)) @@ -299,7 +299,7 @@ export default class Renderer extends Tapable { const isJson = hasReqHeader('accept', 'application/json') || hasReqHeader('user-agent', 'curl/') // Use basic errors when debug mode is disabled - if (!this.options.render.debug) { + if (!this.options.debug) { // Json format is compatible with Youch json responses const json = { status: err.statusCode,