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

TypeError: Parameter 'url' must be a string, not undefined #6

Open
raza2022 opened this issue Jun 16, 2015 · 3 comments
Open

TypeError: Parameter 'url' must be a string, not undefined #6

raza2022 opened this issue Jun 16, 2015 · 3 comments

Comments

@raza2022
Copy link

with css links it works fine, but with js is give me error:
TypeError: Parameter 'url' must be a string, not undefined
here is my code for js
gulp.task('copy-js', function() {
gulp.src('./src/*.html')
.pipe(ghtmlSrc())
// From this point, it's as if you'd used gulp.src() listing each of your
// javascript files that are in your html as <script src="..."></script>
.pipe(uglify())
.pipe(gulp.dest('./build/'));

});

@bruderstein
Copy link
Owner

Could you provide your html? by all means send it privately to me (davegb@pobox.com) if you don't want it public.

@ghost
Copy link

ghost commented Jul 17, 2015

I've just come across this. It occurs with embedded scripts - eg google analytics. It's easy to workaround and even helps with best-practices - just place the script in a separate file and update the script element. But perhaps you should exclude script elements without a src attribute?

I also came across another issue with external scripts. If a script element has an external src, eg a file on a cdn, it silently fails. The output is empty but no error is produced. Again, I can work around this by downloading the script and saving it in a separate file. Perhaps you should exclude scripts whose src can't be resolved locally?

@DBrown2207
Copy link

Fixed in #11

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

3 participants