DocSpring / craco-antd

A craco plugin to use Ant Design with create-react-app
MIT License
234 stars 49 forks source link

CRA 3.4.0 - webpack unknown rule #29

Closed pybuche closed 2 years ago

pybuche commented 4 years ago

Hi !

Updating to CRA 3.4.x results in the production app raising with this log trace:

/app/node_modules/@craco/craco/lib/plugin-utils.js:29
    throw new Error(
    ^

Error: Found an unhandled loader in the production webpack config: /app/node_modules/style-loader/index.js

This error probably occurred because you updated react-scripts or craco. Please try updating craco-less to the latest version:

   $ yarn upgrade craco-less

Or:

   $ npm update craco-less

If that doesn't work, craco-less needs to be fixed to support the latest version.
Please check to see if there's already an issue in the FormAPI/craco-less repo:

   * https://github.com/FormAPI/craco-less/issues?q=is%3Aissue+webpack+unknown+rule

If not, please open an issue and we'll take a look. (Or you can send a PR!)

You might also want to look for related issues in the craco and create-react-app repos:

   * https://github.com/sharegate/craco/issues?q=is%3Aissue+webpack+unknown+rule
   * https://github.com/facebook/create-react-app/issues?q=is%3Aissue+webpack+unknown+rule

    at throwUnexpectedConfigError (/app/node_modules/@craco/craco/lib/plugin-utils.js:29:11)
    at throwError (/app/node_modules/craco-less/lib/craco-less.js:14:5)
    at /app/node_modules/craco-less/lib/craco-less.js:119:7
    at Array.forEach (<anonymous>)
    at Object.overrideWebpackConfig (/app/node_modules/craco-less/lib/craco-less.js:51:11)
    at Object.overrideWebpackConfig (/app/node_modules/craco-antd/lib/craco-antd.js:63:26)
    at overrideWebpack (/app/node_modules/@craco/craco/lib/features/plugins.js:42:40)
    at /app/node_modules/@craco/craco/lib/features/plugins.js:64:29
    at Array.forEach (<anonymous>)
    at applyWebpackConfigPlugins (/app/node_modules/@craco/craco/lib/features/plugins.js:63:29)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! staycation-admin@1.0.0 start: `craco start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the staycation-admin@1.0.0 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!     /app/.npm/_logs/2020-04-30T08_11_08_192Z-debug.log

I tried to PR craco-antd to use the latest version of craco-less, but it looks like we should also update react-scripts, am I right ? https://github.com/DocSpring/craco-antd/pull/28

Thanks !