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

UnhandledPromiseRejectionWarning, when no files match /**/*.s?(c|a)ss #82

Closed
leosuncin opened this issue May 8, 2017 · 6 comments
Closed

Comments

@leosuncin
Copy link

The plugin fail when not found stylesheets for lint and break webpack build, this is a problem in some cases when you're starting a project without styles or embed styles in HTML

Error: /home/leosuncin/Workspaces/github/writtr-frontend/**/*.s?(c|a)ss does not match any files
(node:24485) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'emit' of undefined
(node:24485) 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.
The following tasks did not complete: serve, webpack:watch
Did you forget to signal async completion?

stylelint-webpack-plugin v0.7.0
webpack v2.5.1
gulp v3.9.1
node v7.7.3
npm v4.5.0
Manjaro GNU/Linux 17.0.1

You can clone my repository and view the error

@JaKXz
Copy link
Contributor

JaKXz commented May 16, 2017

This might be an upstream issue with stylelint itself, because I don't think there should be an unhandled rejection when a files are not found in the lint function. All this plugin does is call stylelint.lint and use the results, and if there's an error it should be contained in the error object that we print to the console.

@JaKXz
Copy link
Contributor

JaKXz commented May 27, 2017

That being said if you can reproduce it with a failing test in this repo, that would be awesome :)

@rondonjon
Copy link

rondonjon commented May 30, 2017

@JaKXz, it's actually quite easy to reproduce.

Same problem here. The plugin fails with an error if the context folder contains no stylesheets at all.

Admittedly, this may not be relevant for production builds, but it is quite annoying in other scenarios. For example, I've been running running tests cases on some of my application components with the same webpack configuration as for the actual application. After integrating stylelint-webpack-plugin, these test cases are now failing for all components that don't have stylesheets in their folders/subfolders.

@damianobarbati
Copy link

damianobarbati commented Jun 9, 2017

any news on this? having no stylesheet breaks compilation

@wallzero
Copy link

+1

It's pretty important in scenarios with reusable webpack configurations. Several projects may share the same config but not all may have .css files.

@shellscape
Copy link
Contributor

Closing as stale due to age and inactivity. If there is still interest in this issue, please do submit a pull request.

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

No branches or pull requests

6 participants