nuclear icon indicating copy to clipboard operation
nuclear copied to clipboard

[Build] Invalid configuration object: unknown property 'loaders'

Open Houkime opened this issue 8 years ago • 4 comments

OS: Arch Linux as of 22.06.2018 after $npm install.

$ npm run build:dist

> [email protected] build:dist /home/user/nuclear
> webpack --progress --colors --env=prod --define process.env.NODE_ENV=production && cp loader.css dist

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.module has an unknown property 'loaders'. These properties are valid:                                        
   object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? }         
   -> Options affecting the normal modules (`NormalModuleFactory`).                                                           
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:dist: `webpack --progress --colors --env=prod --define process.env.NODE_ENV=production && cp loader.css dist`
npm ERR! Exit status 1

Problem also shows up when running npm run watch

2018-06-22T18_47_27_632Z-debug.log

Houkime avatar Jun 22 '18 18:06 Houkime

This is probably because the configs are incompatible with Webpack 4. Looking at package.json, it specifies version 4 point something, which is incorrect. I'll take a look after the weekend and resolve it.

nukeop avatar Jun 22 '18 22:06 nukeop

I fixed this problem temporaily for me by downgrading to webpack 3.1.4 and also downgrading webpack-dev-server to 3.0.0 since it relied on Webpack 4.

BrandonS8 avatar Jun 23 '18 03:06 BrandonS8

Well, downgrading never seems like a strategically right choice cause it tends to cause all sorts of troubles for users over time. In Arch ecosystem no good package sets caps on dependency versions because of this. Considered a bad practice. "Either be a good pack or a dead pack."

It is more like the configs need to be updated and not Webpack downgraded.

Houkime avatar Jun 23 '18 07:06 Houkime

I think you can just replace 'loaders' with 'rules' and it'll work with Webpack 4.

nukeop avatar Jun 23 '18 18:06 nukeop