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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悶] qwik-city: vite base doesn't work in dev mode #5984

Open
wmertens opened this issue Mar 9, 2024 · 4 comments 路 May be fixed by #6017
Open

[馃悶] qwik-city: vite base doesn't work in dev mode #5984

wmertens opened this issue Mar 9, 2024 · 4 comments 路 May be fixed by #6017
Labels
COMMUNITY: good first issue Good for newcomers COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it COMP: qwik-city P1: nice to have / fix Not an urgent enhancement or bug (has workarounds) TYPE: bug Something isn't working

Comments

@wmertens
Copy link
Member

wmertens commented Mar 9, 2024

Which component is affected?

Qwik City (routing)

Describe the bug

When you set config.base of vite, the build correctly uses it but dev mode breaks, getting module files without the base path.

Reproduction

https://stackblitz.com/edit/qwik-starter-wvwual?file=vite.config.ts

Steps to reproduce

try clicking Home

System Info

stackblitz, 1.5.1

Additional Information

No response

@wmertens wmertens added TYPE: bug Something isn't working STATUS-1: needs triage New issue which needs to be triaged COMMUNITY: good first issue Good for newcomers COMP: qwik-city COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it P1: nice to have / fix Not an urgent enhancement or bug (has workarounds) and removed STATUS-1: needs triage New issue which needs to be triaged labels Mar 9, 2024
@wmertens
Copy link
Member Author

wmertens commented Mar 9, 2024

Workaround: In your vite config, use

export default defineConfig(({command, mode}) => {
	return {
		base: command === 'build' ? '/your-base/' : undefined,
// ...

@JerryWu1234
Copy link
Contributor

let me pick this up.,

@JerryWu1234
Copy link
Contributor

image
you say this bug ?

@wmertens
Copy link
Member Author

@JerryWu1234 yes it should use the import.meta.env.BASE_URL in front of it

@JerryWu1234 JerryWu1234 linked a pull request Mar 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMMUNITY: good first issue Good for newcomers COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it COMP: qwik-city P1: nice to have / fix Not an urgent enhancement or bug (has workarounds) TYPE: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants