Angular2 server-side rendering not working with matrix-formatted URLs #1446

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

Originally created by @colltoaction on 8/8/2016

Hi,

I have started a new angular2 project with the yeoman generator. I'm setting up the routing but I'm having an issue with the query parameters in matrix URL notation (angular's default) with server-side prerendering.

I'm trying to render http://localhost:5000/shop;page=1;genres=Alternative,Rock, but the = are being encoded and it breaks angular's parsing.

I'm posting here because the first message from the dotnet cli output seems to indicate there's an issue with how the URL is being sent to node from the aspnet side. Having said that, maybe I'm wrong and this is an issue with https://github.com/angular/universal, so let me know!

PS C:> dotnet run
Project MyProject (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
Hosting environment: Production
Content root path: C:\Users\............
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/shop;page%3D1;genres%3DAlternative,Rock

If you need a repro I can work on that, but maybe you already know where and how the urls are being encoded and can easily spot the issue :).

Thanks!

*Originally created by @colltoaction on 8/8/2016* Hi, I have started a new angular2 project with the yeoman generator. I'm setting up the routing but I'm having an issue with the query parameters in matrix URL notation ([angular's default](https://angular.io/docs/ts/latest/guide/router.html)) with server-side prerendering. I'm trying to render `http://localhost:5000/shop;page=1;genres=Alternative,Rock`, but the `=` are being encoded and it breaks angular's parsing. I'm posting here because the first message from the dotnet cli output seems to indicate there's an issue with how the URL is being sent to node from the aspnet side. Having said that, maybe I'm wrong and this is an issue with https://github.com/angular/universal, so let me know! ``` ps PS C:> dotnet run Project MyProject (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation. Hosting environment: Production Content root path: C:\Users\............ Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down. info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 GET http://localhost:5000/shop;page%3D1;genres%3DAlternative,Rock ``` If you need a repro I can work on that, but maybe you already know where and how the urls are being encoded and can easily spot the issue :). Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1446
No description provided.