Static GitHub Issues

[1611] Unable to force Nuxt out of dev mode?

prev: I want to run ‘nuxt generate’ without SourceMap,but I don`t know how to config
next: Blank Screen with SPA mode and Apollo Module

Hi there! I tried asking this in the Gitter, but it might actually be more appropriate for here. I'm running into a weird issue upgrading a Nuxt app from 0.10.7 to 1.0.0-rc11 (having the same issue with rc9). Basically, no matter what I do, Nuxt/Vue seem to be stuck in dev mode. I've confirmed that process.env.NODE_ENV === 'production', but still nothing.

Here's how I'm attempting to set dev mode in my nuxt.config.js:

module.exports = {
  dev: !(process.env.NODE_ENV === 'production'),
  // …
}

I'm then importing that for my server.js:

let nuxtConfig = require('./nuxt.config.js')
console.log('nuxtConfig dev val:', nuxtConfig.dev) // false
const nuxt = new Nuxt(nuxtConfig)

However, when I visit the site after a nuxt build and NODE_ENV=production node server, I get the Vue "You are running Vue in development mode" message, and Vue dev tools work, etc.

As far as I can tell, I'm doing things as recommended by the examples, so I'm wondering if this is some sort of weird edge case with the RC? This setup was working fine under 0.10.7. It's also entirely possible I'm just missing something silly. 🙂

Anyhow, I'm happy to provide any information that would be helpful, just let me know whatever you need.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1440">#c1440</a>)</em></sub></div>