-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix(qwik-city): support vite.base in dev mode #6017
Conversation
👷 Deploy request for qwik-insights pending review.Visit the deploys page to approve it
|
@wmertens didn't finish yet. |
/build is where the scripts are stored by default. The result of this function should then get the vite base added. |
Btw, you can set minify:false in the build to see prod as-is |
I also tested env and pro without base added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, but we need some unit tests and more consistent /
handling
I'll add test after you reviewed. |
@JerryWu1234 how's it going with the tests? Need help? |
@wmertens I haven't tried to add tests yet because I’m waiting for your reply on the problem you mentioned |
@JerryWu1234 which one specifically? I don't have any more information to add right now? |
Here |
So I meant that we should have unit tests, and that you shouldn't have to replace the double slashes if you don't put them in. So you need to be careful about base, don't call replace, and have unit tests that prove it doesn't add double slashes for various test cases |
Let me try to add some tests |
I really need your help. there is a little tricks, To test the base attribute, we need to rely on both build and start. However, the current e2e only has build. If I modify it, I'm afraid it will break the project's testing structure. |
@JerryWu1234 🤔 actually the tests in v2 are a lot better. Take a look at the build/V2 branch, do you think you can incorporate your test there? And actually, maybe that's not needed. It could be enough to make unit tests, not e2e |
https://github.com/BuilderIO/qwik/blob/87f0b9e5acf89f03204cc8e1cddaca8f54ad8ee9/starters/playwright.config.ts#L28 Here is my idea: I referenced the Astro test code, and I think I can dynamically pass in the base parameter in both build and start modes. Vitest can cover most scenarios, but I don't know how to test the qwikLoader function in Vitest, , so I want to use e2e tests. |
sounds good, give it a shot! |
yeah very weird |
oh maybe its erroring since the e2e tests are running the app in a browser so if the files can't load. thats the only thing i can think of |
Head branch was pushed to by a user without write access
idk about this I think we need to make sure /build/ is added for scripts even if base was set |
I think we need to take a step back here.
I see a bunch of duplication around / handling, we can't have that. It needs to be simple throughout, with a helper function if needed. We know that the bases will always end with Furthermore, it's up to the dev to use the vite base in their URLs, we can't add it for them, because there might be links between microfrontends. |
just want to confirm I understand or not. I think we can try to easy way to fix this bug and waiting for built/v2. |
q:base is for assets so it's saying this is where the /build/ files are. I think it makes sense right now to always make sure /build/ is in the url |
👷 Deploy request for qwik-insights pending review.Visit the deploys page to approve it
|
Actually I wonder if b381b22 fixed this - can you check if 1.5.5 still needs this PR @JerryWu1234 ? |
Let me check tomorrow |
Thank you for checking @JerryWu1234, can you figure out exactly what is wrong? Is the q:base wrong, or is it requesting specific files wrongly etc |
Just check where wrong is? or fix it in this PR? |
@JerryWu1234 yes just where. Is it by any chance when it's trying to load |
I'll fix the pr |
In production, is there any workaround to fix this? I'm trying to create a multi-zone in Next.js for a Qwik application, and for that, I need the vite.base set in the configuration to work for all the assets |
I'll revert my changes except for the important ones and update the pr |
Run & review this pull request in StackBlitz Codeflow. @builder.io/qwik (
|
@JuanmaVargas can you use this to test out the changes |
@JerryWu1234 thank you for your efforts, but I think it's fixed now in 1.7.1 (in a different way) so I'll close this. |
Fixes #5984