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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and Serve should account for module polyfills #14293

Closed
AlexAegis opened this issue Apr 27, 2019 · 2 comments
Closed

Build and Serve should account for module polyfills #14293

AlexAegis opened this issue Apr 27, 2019 · 2 comments

Comments

@AlexAegis
Copy link

AlexAegis commented Apr 27, 2019

馃殌 Feature request

Command (mark with an x)

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

Description

I made a polyfill to extend a feature of a node module (RxJS, I added a setter to make a readonly value writable). When manually editing the source of RxJS inside node_modules the polyfill works as expected. However when building the project (--prod --aot), or serving with a clean and fresh node_modules folder, the angular CLI doesn't take my modifications into account and thinks that I'm trying to use something that's not there.

Describe the solution you'd like

Use the polyfills.ts when serving and building the project

Describe alternatives you've considered

Not using the polyfill.

This is the polyfill in question:

import { BehaviorSubject } from 'rxjs';
Object.defineProperty(BehaviorSubject.prototype, 'value', {
	set: function(v) {
		return this.next(v);
	}
});

And the error is thrown where i'm trying to use it in a template file:

[(value)]="myBehaviorSubject.value"
@AlexAegis AlexAegis changed the title Build should account for module polyfills Build and Serve should account for module polyfills Apr 27, 2019
@alan-agius4
Copy link
Collaborator

Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular-cli.

If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.

@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants