yeoman - Gulp-useref is throwing error: "path must be a string" -


I am using a gulpfile.js generated by the mass-sip-webpage generator and A little modified to meet my needs for some reason when I try to run the build process (default task), I am running into a problem. The error 'html' has been thrown during work and most of the error references are in `node_module \ GUI-use \ index.js'.

Here is the error output:

  stream.js: throw 94; // Unwanted flow in pipes TypeError: The path object must be a string on .fs.openSync (fs.js: 427: 18) on object.files.sys (fs.js: 284: 15) on the transform. & Lt; Anonymous & gt; (C: \ Dev Project \ node_modules \ gulp-useref \ index.js: 54: 44) on the array. Then on every (original) conversion. & Lt; Anonymous & gt; (C: \ Dev Project \ node_modules \ gulp-useref \ index.js: 50: 31) at ARR. On each (original) conversion & Lt; Anonymous & gt; (C: \ dev \ project \ node_modules \ gulp-useref \ index.js: 41: 36) but Array.forEf (native) Transform._transform (C: \ dev \ project \ node_modules \ gulp-useref \ index.js: Transform._write (C: \ dev) on Transform._write (C: \ dev \ project \ node_modules \ gulp-useref \ node_modules \ through2 \ node_modules \ readable-stream \ lib \ _stream_transform.js: 184: 10) Here is the HTML function:   

Pre> gulp.task ('html', ['genres', 'script'], function () {var jsFilter = $ .filter ('** / * .js'); var cssFilter = $ .filter ('** / * .css'); return gulp.src (['app / ** / *. Html', 'app / ** / * .php']) .pipe ($ .forref asset ()) Pipe (JSFilt R) .pipe ($ .Uglf ()) .pipe (jsfilter.restore ()) .pipe (cssfilter) .pipe ($ .csso ()) .pipe (cssfilter.restore ()) .pip ($. Restore ()) .Pipe ($. Useref ()) .pipe (gulp.de) cents ('dist') .pip ($. Shape ()); });

short answer: typeError: path must be a string This means that there is a problem with the link / script path

Long answer: I ran away in two issues.

  1. The link / script path is required to be related to gulpfile or there is an alternate directory to search.
  & lt ;! - build: css / styles / main.css - & gt; & Lt; Link href = "app / styles / base.css" & gt; & Lt; Link href = "app / styles / article.css" & gt; & Lt ;! - endbuild - & gt;  

OR

  & lt ;! - Build: CSS (app) /styles/main.css - & gt; & Lt; Link href = "/ styles / base.css" & gt; & Lt; Link href = "/ styles / article.css" & gt; & Lt ;! - endbuild - & gt;    
    > & lt ;! - Build: CSS ({temp, app}) /styles/main.css - & gt; Works

But if you have only one alt directory and you leave it in crispy braces then it throws an error.

  & lt ;! - Build: CSS ({app}) /styles/main.css - & gt; TypeError: The path should be a string  

This is because the path should be in the form of the C: \ path \ to \ project \ {app} \ styles \ style Reading in .css . It seems like strange behavior to me, I would think it would be repeated through the directories listed in the braces despite length.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -