webcontainer-core icon indicating copy to clipboard operation
webcontainer-core copied to clipboard

Angular Web Container Page stuck when starting the page with route/sub-route provided

Open yongshun950824 opened this issue 1 year ago • 0 comments

Describe the bug

The project is successfully built and starts with the initial base URL: https://stackblitzstartersnmnegj-ygow--4200--c9a8a620.local-credentialless.webcontainer.io/.

I can click the button and it will redirect to the page.

However, after I redirect to a certain page (Example: "/home/dashboard"), I try to refresh the current page, and it will be stuck at the Loading... (as in Screenshot 1). I notice that when the browser starts with a route/sub-route (after the base URL) provided, I will encounter this issue.

I noticed that there are the files/scripts (/home/main.js, /home/style.css) are not loaded correctly for the mentioned scenario (Refer to Screenshot 2).

Only when the browser page starts with the base URL, those files are loaded correctly (Refer to Screenshot 3).

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-starters-nmnegj?file=src%2Findex.html

Steps to reproduce

  1. Click any button (Dashboard/Gallery). Angular app will redirect to the page.
  2. Refresh the page (Or provide the route/sub-route: "/home/dashboard" in the browser URL).

Expected behavior

Angular app should successfully browse/redirect to the page when the route/sub-route is provided.

Parity with Local

Screenshots

Screenshot 1

Screenshot 2

Screenshot 3

Platform

  • OS: Windows 11
  • Browser: Chrome
  • Version: 122.0.6261.95

Additional context

No response

yongshun950824 avatar Mar 03 '24 03:03 yongshun950824