-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
The public path setting with history mode #4687
Comments
I ran exactly into this and I am gonna share my findings, in case it helps @pdanpdan. My CaseI have a server (that I load Note that this set-up shouldn't be uncommon -- assets in production should always be served from CDN as they serve no logic at all, and shouldn't cost processing power or data-transfer costs of a server with CPU. However, the initial request (
The problemI found that I need to set On the other hand, apparently However, vue-router is not a big fan of putting domain name in the Now, since the base tag is pointing to CDN and vue-router is passing the relative-path of the current location to My Findings (so far)
|
@eyedean Doesn't setting |
@pdanpdan unfortunately, it doesn't work as expected. I set that up properly (using I put the following in
... and confirmed that it gets populated in PS. I didn't set PPS. I personally feel that |
Update: I managed to get it to work in a way and unblock myself! 🎉
It means that if we set PS. I know it's such a fragile hack. I believe ideally there should be a new config variable (e.g.
Thanks! |
I am back in here to add another note on a similar problem. Having relative (subdirectory) path on dev modeIf you want your dev server to load your assets from const LOCAL_BASE_PATH = `/admin`;
// ...
// then, down in the build section:
build: {
chainWebpack(cfg) {
if (ctx.dev) {
cfg.output.publicPath(LOCAL_BASE_PATH);
}
},
...(ctx.dev ? { publicPath: LOCAL_BASE_PATH } : {}),
appBase: "", (I mentioned it in discord too.) By default dev server serves assets using no path (i.e. Idea for configsIt would be great to have a |
Hi,
the router config ignores /ui/ and starts right at root ('/').
BUT: any subpath path (like /ui/test) are responded by 404 quasar version: 1.15.13 |
@pschrammel See this answer on stackoverflow to get a good grasp of why 404s can happen in SPA (e.g. devServer of Quasar.) You will also need to apply what I mentioned right above your post, if you want to serve your devServer from a subdirectory. |
I think I did everything you wrote in your upper message. |
@pschrammel You might not have much luck receiving 1:1 support on your case here. I'd suggest Quasar's Discord channel, Forum, or Stackoverflow.com Additionally, here are some tips for you to start debugging on your own:
Good luck! |
The publicPath should never be set to a CDN because it will break the whole app. Instead, all images or other assets that you store on CDN should have the full URL specified (which points to the CDN). |
@rstoenescu |
This issue is related to #4460 , #4451 .
My frontend structure like this:
quasarexample.com
is the root host.quasarexample.com/site1
quasarexample.com/site2
quasarexample.com/about
https://cdn.quasarexample.com/js/xsdfdfsdfs.js
.index.html
and some config files which can be mount by k8s file.So that's why I set the publicPath as host in
quasar.conf.js
. But this can cause the history mode error, when switch page under/posts/:id
like router:The url
https://cdn.quasarexample.com/site1/posts/xxxxxxxxxxxx
is wrong, right ishttps://quasarexample.com/site1/posts/xxxxxxxxxxxx
I find the problem is
base
value in head, it built as<base href=cdn.quasarexample.com/>
So can support a confing item to set imported host in
head
, or some advise, thank you!The text was updated successfully, but these errors were encountered: