Skip to content Skip to sidebar Skip to footer

Webpack Babel Es7 Async Function Error "typeerror: (0 , _typeof3.default) Is Not A Function"

I am trying to require in api.js, but receiving the error 'TypeError: (0 , _typeof3.default) is not a function'. Attempting to debug this issue shows that removing 'async' word mak

Solution 1:

This was actually fixed by removing the plugin, transform-runtime. I'm still not sure why this is the case. I would love to get some comments on why.

const path = require('path')

console.log(process.env.NODE_ENV)

module.exports = {
  entry: ['babel-polyfill', './background.js'],
  output: {
    filename: 'background-bundle.js',
    publicPath: 'http://localhost:8090/assets',
    path: '../dist'
  },
  module: {
    loaders: [
      {
        loader: 'babel-loader',
        test: /.jsx?$/,
        exclude: path.resolve(__dirname, "node_modules"),
        query: {
          plugins: ['transform-runtime','syntax-async-functions', 'syntax-decorators'],
          presets: ['es2015','stage-3']
        }
      }
    ]
  },
  externals: {
    //don't bundle the 'react' npm package with our bundle.js//but get it from a global 'React' variable//    'react': 'React'
  },
  resolve: {
    extensions: ['', '.js', '.jsx'],
    alias: {
      config: path.join(__dirname, 'config', process.env.NODE_ENV)
    }
  }
}

Post a Comment for "Webpack Babel Es7 Async Function Error "typeerror: (0 , _typeof3.default) Is Not A Function""