-
Notifications
You must be signed in to change notification settings - Fork 12k
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
serve: serving static files using vite differs from the previous builder #27949
Comments
I had a quick look at this, and what happens here is that express static will redirect to the |
…irectories Prior to this commit, accessing a static asset directory without a trailing slash resulted in a 404 error. With this change, we now redirect to the path with a trailing slash, aligning with the behavior of express static. Closes angular#27949
…irectories Prior to this commit, accessing a static asset directory without a trailing slash resulted in a 404 error. With this change, we now redirect to the path with a trailing slash, aligning with the behavior of express static. Closes angular#27949
…irectories Prior to this commit, accessing a static asset directory without a trailing slash resulted in a 404 error. With this change, we now redirect to the path with a trailing slash, aligning with the behavior of express static. Closes angular#27949
Thank you for the quick fix! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Command
serve
Is this a regression?
The previous version in which this bug was not present was
No response
Description
We are migrating our project to Angular's new build system. It is the preferred option for new projects and we think migrating to it is a good idea. But we have found a small issue with how the static assets are served compared to the previous
browser
builder.Our application requires a bunch of static files to work, and one of the html files is accessed using the parent folder name without a trailing slash:
localhost:4200/oauth2redirect
. Using the previous builder this was loading theoauth2redirect/index.html
file.After migrating to the new
application
builder, this same URI throws the following error:This can be fixed by adding a trailing slash to the URI (
localhost:4200/oauth2redirect/
). But this would require updating our OAuth redirect uri. And since this is something already supported by other tools and platforms (Google Cloud Buckets for example), I think it may be a good idea to support it here as well.Minimal Reproduction
Add some static
index.html
to an angular project:Serve the app
And try to load the file by using its parent folder.
All three URIs work with previous
browser
builder. And the first one fails with the newapplication
builder.Exception or Error
No response
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: