webcontainer-core
webcontainer-core copied to clipboard
Angular Web Container Page stuck when starting the page with route/sub-route provided
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
- Click any button (Dashboard/Gallery). Angular app will redirect to the page.
- 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
- [ ] I have run the project in my local machine and I could not reproduce the issue.
Screenshots
Platform
- OS: Windows 11
- Browser: Chrome
- Version: 122.0.6261.95
Additional context
No response