Chris B.
Chris B.

Reputation: 90211

How do I disable Hot Module Replacement with vue-cli-service serve?

Whenever I run vue-cli-service serve and try to hit the site, I get Uncaught Error: [HMR] Hot Module Replacement is disabled. in my browser.

What's causing this error? I don't want HMR enabled.

Upvotes: 1

Views: 3641

Answers (1)

Bob Fanger
Bob Fanger

Reputation: 29897

Set hotReload to false in the vue-loader.

Sadly changing the loader options for vue-cli doesn't work.

module.exports = {
  chainWebpack: config => {
    config.module
      .rule('vue')
      .use('vue-loader')
        .loader('vue-loader')
        .tap(options => {
          options.hotReload = false
          return options
        })
  }
}

Run vue-cli-service serve --mode=production which disables HMR, but also does more than that.

Upvotes: 2

Related Questions