yeoman / generator-webapp

A gulp.js generator for modern webapps
3.77k stars 708 forks source link

Uncaught ReferenceError #653

Closed jaysunwalter123 closed 5 years ago

jaysunwalter123 commented 7 years ago

Hi. I'm having problem calling custom scripts from the 'scripts' folder.

I get: "Uncaught ReferenceError: name-of-function is not defined".

It doesn't matter what script I use. I even get the issue with Bootstrap scripts which when called from the bower folder don't give the issue.

Any help would be appreciated here. Thanks

neilhem commented 7 years ago

Hi, how do you include scripts? You should include scripts in html in right order.

jaysunwalter123 commented 7 years ago

I just realised that there seems to be a problem with file injection into the index.html when installing any bower components. They download to the bower_components folder and get added to bower.json but not injected into the index.html.

I also tested this on a fresh project and it won't do it. Do you know if this is this a known problem with generator-webapp @neilhem?

This is somewhat related to my previous question above as this is the error I get when calling any script in main.js. Of course it's happening because the scripts aren't actually being injected and therefore the uncaught reference error.

In the meantime I'm going to have to manually include scripts :/

Thanks.

silvenon commented 7 years ago

@jaysunwalter123 hey! They should be injected as soon as you run gulp serve, otherwise run gulp wiredep manually.

silvenon commented 5 years ago

Released lots of changes in v4.0.0-0, where we removed Bower. In that release you should add vendor assets manually.