Skip to content

ng build --watch can not load some old es5 librares #15102

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

Closed
steve3d opened this issue Jul 17, 2019 · 2 comments · Fixed by #15120
Closed

ng build --watch can not load some old es5 librares #15102

steve3d opened this issue Jul 17, 2019 · 2 comments · Fixed by #15120

Comments

@steve3d
Copy link

steve3d commented Jul 17, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

@angular/cli<8.1.0 are good, so I think it is

Description

I'm using angular with laravel, so I can not directly use ng serve to test my site, but after I upgrade angular to 8.1.0, I found that ng build --watch can not work, before the upgrade, it's fine.

🔬 Minimal Reproduction

steps to reproduction:

  • cd webroot folder
  • ng new test-app
  • npm add -D holderjs
  • add "node_modules/holderjs/holder.min.js" to angular.json's scripts part
  • change base tag in index.html to something like /test-app/dist/test-app/, and it must be the correct folder
  • ng build --watch
  • open url like https://localhost/test-app/dist/test-app then, you will find that holderjs can not be loaded, because, there is no window object exists when running the holder.min.js

but if I use ng serve, then holderjs will NOT throw any error. this only happens when I'm using --watch

🌍 Your Environment

Angular CLI: 8.1.1
Node: 10.16.0
OS: darwin x64
Angular: 8.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.1
@angular-devkit/build-angular     0.801.1
@angular-devkit/build-optimizer   0.801.1
@angular-devkit/build-webpack     0.801.1
@angular-devkit/core              8.1.1
@angular-devkit/schematics        8.1.1
@ngtools/webpack                  8.1.1
@schematics/angular               8.1.1
@schematics/update                0.801.1
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.35.2

Anything else relevant?
no

@steve3d
Copy link
Author

steve3d commented Jul 17, 2019

not only this happens to holder.js, for my project, I'm using holderjs and fancybox, they all have this problem. so I believe this is a bug in @angular/cli

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.