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

Router should not mutate Route config objects because it causes issue with platform-server #22203

Closed
vikerman opened this issue Feb 13, 2018 · 2 comments · Fixed by Xenira/Shashki#73

Comments

@vikerman
Copy link
Contributor

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Router mutates Route[] object created by the user and configure in NgModule by writing extra _loadedConfig field.

This is ok for platform-browser by not for platform-server where parallel requests are sharing the same Route[] object.

Expected behavior

Router should create a copy of the Route config per application before mutating it.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

This is to make sure Router works properly on the server environment

Environment


Angular version: latest

For Tooling issues:
any

Others:
-
jasonaden added a commit to jasonaden/angular that referenced this issue Feb 22, 2018
vicb pushed a commit that referenced this issue Feb 22, 2018
@vicb vicb closed this as completed in 45eff4c Feb 22, 2018
smdunn pushed a commit to smdunn/angular that referenced this issue Feb 28, 2018
This was referenced Mar 15, 2018
This was referenced Mar 15, 2018
@Longfld
Copy link

Longfld commented Mar 22, 2018

Hi,
that change breaks my current application,.
Could you please give a sample, how we should use it after your changes?
This is not suppose to be breaking changes

leo6104 pushed a commit to leo6104/angular that referenced this issue Mar 25, 2018
jmleoni pushed a commit to jmleoni/angular that referenced this issue Oct 6, 2018
@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 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.