Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found an unhandled loader in the developement webpack config: .../node_modules/style-loader/index.js #51

Closed
cosydney opened this issue Oct 18, 2020 · 6 comments

Comments

@cosydney
Copy link

Hey,

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.
@cosydney cosydney changed the title Found an unhandled loader in the developement webpack config: [...]/node_modules/style-loader/index.js Found an unhandled loader in the developement webpack config: .../node_modules/style-loader/index.js Oct 18, 2020
@cosydney
Copy link
Author

cosydney commented Oct 18, 2020

Related issue on this thread: #30 CRA 3.3.0 - webpack unknown rule

@sadsa
Copy link

sadsa commented Oct 22, 2020

@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.

@cosydney
Copy link
Author

@sadsa Thank you it's exactly what happened, I changed my NODE_ENV variable and this cause that issue !

@AsmaDhanePersonal
Copy link

Any update to this issue please?

@russelldc
Copy link

russelldc commented Mar 30, 2021

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, but craco 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

@Aashir1
Copy link

Aashir1 commented Jan 2, 2024

Thanks, @sadsa! I've been struggling since yesterday, but just by setting NODE_ENV=development, I managed to sort out this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants