Skip to content
Advertisement

Webpack fails with no error due to import keyword

I’m receiving a weird error npm ERR! code 1 when trying to launch the dev server or run a build.

I’ve researched this problem for a while with no success whatsoever.

The problem manifests itself when I try to import an image in a js file from the src folder.

JavaScript

Or when I try to import sass partials from the sass folder into app.scss.

JavaScript

Here is the NPM error message:

JavaScript

Here is a piece of the error output from the terminal:

JavaScript

webpack.config.js file:

JavaScript

package.json file:

JavaScript

Advertisement

Answer

Problem solved by removing the generator from the font import in webpack.config.js, going from this :

JavaScript

To this :

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