30

After renaming my file I am getting the following error when running the gulp build task:

Error: Error: File not found with singular glob: F:\Projects\xyz\HTML\app\css\main.css
    at DestroyableTransform.<anonymous> (F:\Projects\xyz\HTML\node_modules\gulp-useref\lib\streamManager.js:90:36)

main.css file no longer exists as I changed it to style.css but for some reason it is searching for the old file.

Imran Bughio
  • 4,811
  • 2
  • 30
  • 53

2 Answers2

34

As it turns out I missed changing file name in HTML file as it was calling main.css instead of style.css.

<!--build:css css/main.min.css -->
<link rel="stylesheet" href="css/main.css">
<!-- endbuild -->

Changed it to:

<!--build:css css/style.min.css -->
<link rel="stylesheet" href="css/style.css">
<!-- endbuild -->

An honest mistake but I believe someone else can run into something similar :)

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
Imran Bughio
  • 4,811
  • 2
  • 30
  • 53
  • 9
    It may be worth noting that if there are any breakages in your less files (e.g. wrong less file reference or incorrect syntax) your generated css won't be built and thus you'll also run into the same error. – arete Oct 10 '16 at 18:14
2

In my case, removing these files:

  • package-lock.json
  • node_modules folder
  • any .tmp or dist folder

And then reinstall dependencies using:

npm i
Asef Hossini
  • 655
  • 8
  • 11