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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After build, if there is an error in the script in the code, it will cause a white screen instead of entering the error page #687

Closed
sunseekers opened this issue Mar 8, 2023 · 6 comments
Labels

Comments

@sunseekers
Copy link

sunseekers commented Mar 8, 2023

Description

If there is an error in the script, a white screen page will appear instead of entering 500

I hope that there will be no white screen of the page under any circumstances, either a 404 page or a 500

@brillout
Copy link
Member

brillout commented Mar 8, 2023

I agree. I'll need a reproduction.

@brillout brillout changed the title After build, if there is an error in the script in the code, it will cause a white screen instead of entering 404 After build, if there is an error in the script in the code, it will cause a white screen instead of entering 500 Mar 8, 2023
@brillout brillout changed the title After build, if there is an error in the script in the code, it will cause a white screen instead of entering 500 After build, if there is an error in the script in the code, it will cause a white screen instead of entering the error page Mar 8, 2023
@sunseekers
Copy link
Author

I agree. I'll need a reproduction.

  1. pnpm create vite-plugin-ssr

  2. Add a sentence to the pages/index/index.page.vue script file of the project such as:
    throw new Error()

image

pnpm dev 

as expected because 500 Interwewewnal Server Error
pnpm build 

pnpm server:prod

not as expected because page white screen

@hellohejinyu
Copy link

image
image

I observed that if an error is reported in the setup, the template data will be lost in the build product. I don't know much about vue ssr and I don't know if this is intended by design.

@brillout
Copy link
Member

@sunseekers Indeed, I could reproduce. I'll have a look at it.

@hellohejinyu Intersting. Maybe it lives in another file? Have you compared without throw new Error()?

@brillout
Copy link
Member

It's a Vue bug. Closing in favor of vuejs/core#7876.

@brillout brillout closed this as not planned Won't fix, can't repro, duplicate, stale Mar 10, 2023
@brillout
Copy link
Member

Workaround: 169677a.

For more context: vuejs/core#7876 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants