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

Bootstrap script not being injected #565

Closed
jnwelzel opened this issue Sep 17, 2014 · 12 comments
Closed

Bootstrap script not being injected #565

jnwelzel opened this issue Sep 17, 2014 · 12 comments
Assignees
Labels
Milestone

Comments

@jnwelzel
Copy link

Hi!

Thanks for your awesome generator, it has made life a lot easier for me!

I recently deployed an app to production using yo angular-fullstack:heroku, but I noticed that the bootstrap-related javascript was not being loaded as I tried to open a modal. I declared the bootstrap .js file as a bower dependency in index.html and all...

I tried looking around the config files etc, but I'm pretty new to this frontend stack and couldn't figure out what could be wrong. I'd appreciate any input on this.

Thanks!

@remicastaing
Copy link
Contributor

Take a look at @kingcody comment in issue #554.

@jnwelzel
Copy link
Author

Thanks for your reply @remicastaing but unfortunately it didn't solve the problem. I added <script src="bower_components/bootstrap/js/modal.js"></script> to the index.html file, removed the /bootstrap.js entry from the wiredep config entry like suggested in the issue you mentioned but after running grunt serve or any other build command the bootstrap js declaration gets removed from the html file.

@kingcody
Copy link
Member

@jnwelzel can you confirm that bootstrap is listed as a dependency in bower.json and that it is installed at client/bower_components/bootstrap?

Also, in client/index.html everything between injector or bower comment tags is automatically generated on every build/serve, that's why your custom entry was being overridden. However, you shouldn't need one.

@jnwelzel
Copy link
Author

Hi @kingcody thx for your input.
Below are two images that answer your questions:
bowerjson
components

@kingcody
Copy link
Member

@jnwelzel, haha. A simple "yes" would have sufficed :)

So wiredep isn't injecting bootstrap.js into your index.html, even after removing the regexp from the exclude array?

@jnwelzel
Copy link
Author

Ok, so after all my previous attempts, I decided to try one more time the removing the regexp from the exclude array approach and this time it worked. Only thing that's different from yesterday is that I updated Bower from 1.3.9 to 1.3.10. I really don't know what else to tell ya. Thanks for all the support though!

@kingcody
Copy link
Member

No problem, I'm glad to see you got it worked out.

@young-utf
Copy link

I'am having same problem, Where can I find the array you guys mentioned ?

@MichaelJCole
Copy link

It's in Gruntfile.js, in the 'wiredep' section.

@SaintPeter
Copy link
Contributor

I don't understand why this is still true. This was confusing as heck, as to why my bootstrap.js was not being loaded.

@kingcody
Copy link
Member

@SaintPeter this is a bug, the bootstrap.js exclude regexp should only be included when filters.uibootstrap === true. I'll try to get a PR together that addresses the issue. However, if this is something that you feel comfortable fixing; then by all means, submit a PR.

@SaintPeter
Copy link
Contributor

@kingcody Pull Request submitted. I have not tested it, but it's very straightforward.

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

No branches or pull requests

7 participants