A
A
Alexander Marginal2018-06-02 16:06:55
webpack
Alexander Marginal, 2018-06-02 16:06:55

webpack not working?

The tutorial in webpack setup says

new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()

But when I run npm start I get this:

> [email protected] start /Users/alexandermarginal/WebstormProjects/redux
> node server.js
/Users/alexandermarginal/WebstormProjects/redux/webpack.config.js:19
new webpack.NoErrorsPlugin()
^
TypeError: webpack.NoErrorsPlugin is not a constructor
at Object. (/Users/alexandermarginal/WebstormProjects/redux/webpack.config.js:19:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10 )
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596 :17)
at require(internal/module.js:11:18)
at Object. (/Users/alexandermarginal/WebstormProjects/redux/server.js:7:14)
at Module._compile (module.js:652:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexandermarginal/.npm/_logs/2018-06-02T13_03_07_929Z-debug.log

If I comment these plugins, the error looks like this:

WebpackOptionsValidationError: 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`).
at webpack (/Users/alexandermarginal/WebstormProjects/redux/node_modules/webpack/lib/webpack.js:24:9)
at Object. (/Users/alexandermarginal/WebstormProjects/redux/server.js:12:16)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693 :10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexandermarginal/.npm/_logs/2018-06-02T13_04_28_830Z-debug.log
Process finished with exit code 1

All errors point to the webpack config connection string and to the webpack js file itself

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xnkka, 2020-05-25
@xnkka

NoErrorsPlugin is considered obsolete and renamed to NoEmitOnErrorsPlugin: link
ps I am aware that the question is old, but it's not nice to leave it unanswered, suddenly it will come in handy for someone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question