react-webpack-generators / generator-react-webpack

Yeoman generator for ReactJS and Webpack
http://newtriks.com/2013/12/31/automating-react-with-yeoman-and-grunt/
MIT License
2.88k stars 355 forks source link

V4 -- Webpack #304

Closed stylesuxx closed 7 years ago

stylesuxx commented 7 years ago

V4, current master breaks with the newest webpack version. The last working version is webpack@2.1.0-beta.6

npm start       

> grw-1@0.0.1 start /home/chris/Projekte/testing/grw_1
> npm run serve:dev

> grw-1@0.0.1 serve:dev /home/chris/Projekte/testing/grw_1
> webpack-dev-server --open --env dev

/home/chris/Projekte/testing/grw_1/node_modules/webpack/lib/webpack.js:17
        throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);
        ^
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'debug'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
   The 'debug' property was removed in webpack 2.
   Loaders should be updated to allow passing this option via loader options in module.rules.
   Until loaders are updated one can use the LoaderOptionsPlugin to switch loaders into debug mode:
   plugins: [
     new webpack.LoaderOptionsPlugin({
       debug: true
     })
   ]
 - configuration.module has an unknown property 'preLoaders'. These properties are valid:
   object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, loaders?, noParse?, rules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
   Options affecting the normal modules (`NormalModuleFactory`).
 - configuration.resolve.extensions[0] should not be empty.
    at webpack (/home/chris/Projekte/testing/grw_1/node_modules/webpack/lib/webpack.js:17:9)
    at Object.<anonymous> (/home/chris/Projekte/testing/grw_1/node_modules/webpack-dev-server/bin/webpack-dev-server.js:236:12)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:139:18)
    at node.js:999:3

See here https://github.com/stylesuxx/generator-react-webpack-redux/issues/46#issuecomment-257065492

FYI, I updated my fork and started working on fixing this.

Ah, webpack config is part of the template...

sthzg commented 7 years ago

@stylesuxx thanks for reporting. It's side-tracked in the template repo https://github.com/react-webpack-generators/react-webpack-template/issues/68#issuecomment-251800701, but unfortunately not published right now.

gaboAcosta commented 7 years ago

How can I use an older version of the scaffold, as is I can't work with this :(

sthzg commented 7 years ago

@gaboAcosta how did you install the generator? I am curious, since npm install generator-react-webpack references the latest stable 3.x. line, which does not contain the error mentioned by @stylesuxx (it however suffers from https://github.com/react-webpack-generators/generator-react-webpack/issues/302, which will be resolved shortly)

matty commented 7 years ago

@sthzg I've just installed this generator and my React version is specified as "dependencies": { "core-js": "^2.0.0", "normalize.css": "^4.0.0", "react": "^15.0.0", "react-dom": "^15.0.0" }

v15.0.0. I am still getting the issue with #302 how can I get it running?

sthzg commented 7 years ago

hi @matty, ^15.0.0 means that npm will install the latest 15.x release, so you will have 15.4.x installed. Until fixed, this workaround works great (it should be added to the alias object in cfg/base.js). For further discussion about #302 lets continue communication there, as this issue has a different scope.

sthzg commented 7 years ago

Fixed and published to npm. Thanks @stylesuxx for the PR(s).