Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved log in console #8

Closed
wants to merge 1 commit into from
Closed

Improved log in console #8

wants to merge 1 commit into from

Conversation

evenstensberg
Copy link

I was having this issue when setting up webpack 2.0 with ES6 and arrow functions. I had no idea that I removed a bracket when deleting one of my plugins and it threw an odd error. I didn't know what the case was and used a lot of time trying to figure out what went wrong. This could potentially help a lot of developers to get a clue what went wrong when transpiling webpack.config with babel through renaming (webpack.babel.config.js)

@gajus
Copy link
Owner

gajus commented Jun 21, 2016

Can you provide a code example that broke and triggered this error?

@evenstensberg
Copy link
Author

const {resolve} = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')

const isProd = process.env.NODE_ENV === 'production'
const isTest = process.env.NODE_ENV === 'test'

module.exports = env => {
  return {
    entry: {
      app: './app.js',
    },
    output: {
      filename: 'bundle[name].js',
      path: resolve(__dirname, 'dist'),
      pathinfo: !env.prod,
    },
    context: resolve(__dirname, 'scr'),
    devtool: env.prod ? 'source-map' : 'eval',
    bail: env.prod,
    module: {
      loaders: [
        {test: /\.js$/, loader: 'babel!eslint', exclude: /node_modules/}
      ]
    },
    plugins: [
      env.test ? undefined : new HtmlWebpackPlugin({
        template: './index.html'
      }),

      env.test ? undefined : new webpack.optimize.CommonsChunkPlugin({
        name: 'common',
        filename: 'bundle.common.js'
      })
    ]
}

@gajus
Copy link
Owner

gajus commented Jun 22, 2016

How would a missing bracket in this code cause

Cannot remove "babel-plugin-transform-es2015-modules-commonjs" from the plugin list.

error?

@evenstensberg
Copy link
Author

evenstensberg commented Jun 22, 2016

I'm transpiling the config through babel first 😄 ( webpack 2.0)

@matt-mcdaniel
Copy link
Contributor

I currently have an issue open for receiving the same error. In my case, this warning would not be helpful, as there are no syntax errors in my webpack file.

@evenstensberg
Copy link
Author

Probably should add up that you need to check loaders or babel file too, but that seems a bit volatile to me

@matt-mcdaniel
Copy link
Contributor

Alternatively, the error itself could be made to be more accurate.

@evenstensberg
Copy link
Author

Generally something is wrong in your config file if you forgot a plugin :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants