Skip to content
Advertisement

Webpack.config.js: Configuration has an unknown property ‘default’

I’ve moved everything over from a working project (ultimate-hot-reloading-example), to an existing project of mine that uses the keystone cms. I uninstalled ALL dev dependencies in my project, and installed all of the exact dependencies in the working project into mine (webpack, babel, etc…).

For some reason, the web.config.js file won’t parse the es6 syntax

JavaScript

Which gives this error:

JavaScript

If I switch to the following, it works:

JavaScript

Elsewhere in my project, I use other es6 syntax and it works…

Here’s the dependencies in package.json, which works perfectly with the example project with the ‘export default’ syntax.

JavaScript

Any idea why this would happen?

Advertisement

Answer

I had a similar problem which turned to be my improper migration from require(...) to import(...)

I replaced this code:

JavaScript

with:

JavaScript

The problem was that I didn’t use the default export from webpack.common.js. The fix is:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement