-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Incorrect configuration of 'base' in vue-cli-plugin-router #4304
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
Comments
Next time please provide a reproduction. I think we have made it clear in the documentation:
So the problem is that we didn't take I'm not sure whether we should strip the domain name in the CLI template or in router, though. /cc @posva |
if what the OP wants is to change the domain in the URL that is simply not feasible. Even if we support removing the domain from the base option (as we do when it comes from the It would be a huge security problem if you could change the full URL while keeping the content 😅 |
Oh got it. |
I think the base option makes more sense without the domain as it will be ignored anyway |
Need i provide a reproduction? |
There are 3 places that referenced
If |
There's another problem i could not understand.Why it cause this problem only when i use the char like '@',but use the char which no need to encode is ok |
@sodatea ,If I want to use CDN, can I just remove this line in router config? |
@zhj135 yeah just remove this line for now. |
@sodatea Can you help me to solve this puzzle 5 days ago😅? |
@soouup @posva Is is considered a bug? |
@sodatea I'm sorry, I really don't what we are talking about, if @soouup provides a boiled down repro explaining the problem they are facing with the |
@posva here:https://github.com/soouup/router-demo |
I don't see a redirection problem, so it must be something with your nginx config. To be clear, the correct query is |
@posva The initial problem is the misleading default But during the investigation, we revealed a strange behavior in router that this redirection only happens when the url fragment contains a special character. After digging into the code of |
@sodatea Ah I see. As long as the problem does not appear when a correct |
Version
3.4.0
Environment info
Steps to reproduce
1.Create a program with vue-cli3(includes router)
2.In vue.config.js: Set 'publicPath' with the domain which different from index.html(like: website on abc.com while publicPath on def.com)
3.Visit the website with invalid words(like '@'): abc.com?a=@
What is expected?
Just at abc.com?a=%40
What is actually happening?
Jump to abc.com/def.com?a=%40
we checked the vue-cli-plugin-router,found that in router config there is: 'base: process.env.BASE_URL',and in vue-cli-service the 'process.env.BASE_URL' was assign to the 'publicPath'. We remove 'base: process.env.BASE_URL',Then everything is ok.
So... Is 'base: process.env.BASE_URL' a right config?
The text was updated successfully, but these errors were encountered: