Found an unhandled loader in the developement webpack config: .../node_modules/style-loader/index.js
See original GitHub issueHey,
I get a upgrade craco-less error but even though I updgrade it doesn’t change anything. It is weird because it was working yesterday and I have not made any major changes since yesterday it just started throwing this error.
I’m using latest version of craco and craco-less:
"@craco/craco": "^5.7.0",
"craco-less": "^1.17.0",
Thanks
(node:11523) UnhandledPromiseRejectionWarning: Error: Found an unhandled loader in the developement webpack config: 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 (.../node_modules/@craco/craco/lib/plugin-utils.js:29:11)
at throwError (.../node_modules/craco-less/lib/craco-less.js:14:5)
at .../node_modules/craco-less/lib/craco-less.js:119:7
at Array.forEach (<anonymous>)
at Object.overrideWebpackConfig (.../node_modules/craco-less/lib/craco-less.js:51:11)
at overrideWebpack (.../node_modules/@craco/craco/lib/features/plugins.js:42:40)
at .../node_modules/@craco/craco/lib/features/plugins.js:64:29
at Array.forEach (<anonymous>)
at applyWebpackConfigPlugins (.../node_modules/@craco/craco/lib/features/plugins.js:63:29)
at mergeWebpackConfig (.../node_modules/@craco/craco/lib/features/webpack/merge-webpack-config.js:67:30)
(node:11523) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11523) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
webpack-cli failed to load webpack.config.js and couldn't ...
I use Linux. i think this part is causing the error in your configuration: "dev": "webpack --mode development", ...
Read more >Top 5 @craco/craco Code Examples
Learn more about how to use @craco/craco, based on @craco/craco code examples created from the most popular ways it is used in public...
Read more >New York City Atlas Search Restaurant Finder Tutorial ...
... getting craco: *** Cannot find ESLint loader (eslint-loader) ... /craco/lib/features/webpack/style/style.js:9:25) at mergeWebpackConfig ...
Read more >@craco/craco - npm
config.js:23 throw new Error( ^ Error: Can't find eslint-loader in the webpack config! This ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cosydney - I also experienced a similar issue today. Can you confirm what your NodeJS NODE_ENV variable is? When I set mine to production, I saw this error, but when I set it back to development, the issue disappeared.
You should be able to see this by typing node in the command prompt which will open the node shell and then type process.env.NODE_ENV.
On the latest version of react-scripts, craco and craco-less, it seems like production builds are silently failing to compile less files.
Running with
craco start
will add our index.less to the app, butcraco build
does not.Running
craco start
with NODE_ENV set to production highlights what I think might be the real issue?The same exact behavior is also happening when I tried downgrading to: react-scripts@^3.2.0: 3.4.4 @craco/craco@^5.5.0: 5.9.0