-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
pages contains process.env.NODE_ENV !== 'production'
report 404 error
#419
Comments
This seems to be a bug of https://github.com/vitejs/vite vitepress/src/client/app/index.ts Line 119 in 773472d
|
More precisely, my observations are it’s just I was about to report the same thing so I have another example repo. |
It could be nice to merge that pull request knowing the issue is resolved on it. |
Same issue here: https://github.com/vuejs/devtools/blob/6d8aba08346528847b361b0991073934bd324531/docs/plugin/plugins-guide.md I can reproduce with the following page: https://gist.github.com/Akryum/912fa79590605925753b93cbd75b6440
|
News about this issue? |
I can reproduce this issue too, but how come current Vite site is working 🤔 It's using 0.22.4 (the latest) I think. |
Oh, OK. Build works. It's failing on Dev mode only. Still we need to fix this. |
Discussion is going on at vitejs/vite#5577 and Vite team is aware of this. Until it gets resolved, please workaround this issue with 👉 vitejs/vite#5577 (comment) We'll absolutely need to fix this before 1.0.0. |
I found the cause is that So a possible fix is to implement the build mode workaround to dev mode, too. But I'm still curious about why that's happening |
I found the reason, vite always statically replaces Now the solution is simple: always "escape" |
Describe the bug
any page which contains
process.env.NODE_ENV !== 'production'
, it will report 404 errorReproduction
step 1: clone https://github.com/Alanscut/vitepress-demo
step 2: run the project
step 3: visit the page
Expected behavior
could visit the page normally, the page will show:
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: