[Vuejs]-VueJS @google-cloud/logging-winston TypeError: The "original" argument must be of type Function

0👍

As mentioned in the Github link by @bcoe try adding the following to your webpack.config.js:

module.exports = {
resolve: {
    extensions: ['.js'],
    alias: {
        fs: path.resolve(__dirname, 'src/mock-fs.js')
    }
  }
};

Also mentioned in the document:

If you need conditional behavior based on the environment, or want to
directly mutate the config, use a function (which will be lazy
evaluated after the env variables are set). The function receives the
resolved config as the argument. Inside the function, you can either
mutate the config directly, OR return an object which will be merged.

Refer to the code:

    // vue.config.js
    module.exports = {
      configureWebpack: config => {
        if (process.env.NODE_ENV === 'production') {
          // mutate config for production...
        } else {
          // mutate for development...
        }
      }

}

Leave a comment