Skip to content
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

astro preview appends / to stylesheet URLs in some circumstances #10481

Closed
1 task done
castarco opened this issue Mar 19, 2024 · 0 comments · Fixed by #10491
Closed
1 task done

astro preview appends / to stylesheet URLs in some circumstances #10481

castarco opened this issue Mar 19, 2024 · 0 comments · Fixed by #10491
Labels
needs triage Issue needs to be triaged

Comments

@castarco
Copy link
Contributor

Astro Info

Astro                    v4.5.6
Node                     v18.18.0
System                   Linux (x64)
Package Manager          npm
Output                   hybrid
Adapter                  @astrojs/node
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Given the following circumstances:

  • output is set to hybrid
  • We use the node adapter
  • trailingSlash is set to always

Then, when running our web app in preview mode with astro preview:

  1. many static resources loaded by the page (such as .css or .js files) return a 301 status code
  2. redirecting us to an URL with an appended / (that's OK for pages, but certainly not for .css or .js files)
  3. which in turn returns us a 404

What's the expected result?

There shouldn't be any forced redirection to routes with an appended trailing slash for subresources such as .css or .js files.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-qrbb9r?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant