Server-side rendering baseUrl not being set #552

Closed
opened 2025-08-09 17:16:44 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @stephenlautier on 7/25/2017

Not sure if this is a bug or I'm missing something out, however, I'm configuring the base tag within _Layout.cshtml and the params.baseUrl within server side rendering is not being set.

This is what I'm doing:

<base href="/@Model.Locale/" />

// which output the following
<base href="/en/" />

After debugging the server-side rendering, I've noticed that the params.baseUrl is set as "/"

// refering to the following
{ provide: APP_BASE_HREF, useValue: params.baseUrl }

// params.baseUrl => "/"

2017-07-25 17_07_05-developer tools - node

Expected
I expect that the baseUrl is set accordingly from the specified base element.

Issue
The issue I'm getting due to this it's always landing on the home page, irrespective on which page I actually go and then re-route afterward.

*Originally created by @stephenlautier on 7/25/2017* Not sure if this is a bug or I'm missing something out, however, I'm configuring the `base` tag within `_Layout.cshtml` and the `params.baseUrl` within server side rendering is not being set. This is what I'm doing: ```html <base href="/@Model.Locale/" /> // which output the following <base href="/en/" /> ``` After debugging the server-side rendering, I've noticed that the `params.baseUrl` is set as `"/"` ```ts // refering to the following { provide: APP_BASE_HREF, useValue: params.baseUrl } // params.baseUrl => "/" ``` ![2017-07-25 17_07_05-developer tools - node](https://user-images.githubusercontent.com/3908723/28579142-15ac1194-715c-11e7-83de-c1f2803ccf30.png) **Expected** I expect that the `baseUrl` is set accordingly from the specified `base` element. **Issue** The issue I'm getting due to this it's always landing on the home page, irrespective on which page I actually go and then re-route afterward.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#552
No description provided.