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

base url not working as expected during dev #11445

Closed
1 task done
patheticGeek opened this issue Jul 10, 2024 · 3 comments
Closed
1 task done

base url not working as expected during dev #11445

patheticGeek opened this issue Jul 10, 2024 · 3 comments
Labels
needs triage Issue needs to be triaged

Comments

@patheticGeek
Copy link

patheticGeek commented Jul 10, 2024

Astro Info

Astro                    v4.11.5
Node                     v18.20.3
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

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

No response

Describe the Bug

When setting the base url to /base
In dev:
The styles/scripts which are added by astro/vite themselves do not have the base prepended
eg. /@vite/client, all /@fs/*, /node_modules/* etc.

What's the expected result?

All assets should have their urls prepended with base
eg. /base/@vite/client, /base/@fs/*, /base/node_modules/* etc.

In a vite react project during dev. when the base is set:
All the scripts/styles injected contain that base path.
Example: https://stackblitz.com/edit/vitejs-vite-nmbndk

In prod the base url works as expected and is prepended to all assets.

This is important in the scenario where astro server is running behind a proxy and we need to forward all assets call to a server.

I didnt find any docs on what urls are used otherwise one hack would be to forward those reqs. but that could break in case we have two astro servers behind a proxy

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-5atatw

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jul 10, 2024
@florian-lefebvre
Copy link
Member

Maybe duplicate of #7520?

@patheticGeek
Copy link
Author

Maybe duplicate of #7520?

it is can mark that

@florian-lefebvre
Copy link
Member

Duplicate (feel free to reopen if I misunderstood)

@florian-lefebvre florian-lefebvre closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
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

No branches or pull requests

2 participants