You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when it comes to serving the web site, all requests (including static file requests like https://MY_DOMAIN/london/fileshare/assets/index-c9fdd385.css return index.html because it's clearly looking for a static file at london/fileshare/assets/index-c9fdd385.css rather than assets/index-c9fdd385.css. This is because there is no way to tell the web server this is being accessed from a local path.
If I omit the base value from vite.config.js, it renders the assets to /assets/index-c9fdd385.css and the root directory is obviously outside of the application so will fail too.
Clearly the web server just needs to be aware of the relative path prefix?
Environment Versions
OS Type macOS and ubuntu/node docker images - it's a conceptual problem which exists regardless of OS
Make a request and watch the .css and .js requests fail to connect to the static files
Expected result
Be able to inform the http-server about the relative path, and for it not to be included when locating static content.
Actual result
http-server is using the relative path prefix when looking for local static file content, it should instead be trimming this from the request path first.
The text was updated successfully, but these errors were encountered:
Also: AFAIK there are just 2 people with maintainer access of this project and neither of them has shown any interest in the last year, so you might be better off switching to serve, which supports rewrites: https://github.com/vercel/serve-handler#rewrites-array
Yikes, such as shame.
Let's hope our new AI overlords don't get bored so easily 🤣
I read somewhere that 45% of code written on GitHub is now AI generated?!
I am trying to deploy a UI which is accessed from a relative path rather than root directory:
https://MY_DOMAIN.TLD/london/fileshare
To achieve this, I have a relative path set in my VueJS vite.config.js file:
However, when it comes to serving the web site, all requests (including static file requests like
https://MY_DOMAIN/london/fileshare/assets/index-c9fdd385.css
return index.html because it's clearly looking for a static file atlondon/fileshare/assets/index-c9fdd385.css
rather thanassets/index-c9fdd385.css
. This is because there is no way to tell the web server this is being accessed from a local path.If I omit the
base
value from vite.config.js, it renders the assets to/assets/index-c9fdd385.css
and the root directory is obviously outside of the application so will fail too.Clearly the web server just needs to be aware of the relative path prefix?
Environment Versions
$ node --version
:latest
docker imageSteps to reproduce
base
path in vite.config.jsExpected result
Be able to inform the http-server about the relative path, and for it not to be included when locating static content.
Actual result
http-server is using the relative path prefix when looking for local static file content, it should instead be trimming this from the request path first.
The text was updated successfully, but these errors were encountered: