vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.81k stars 6.22k forks source link

fix(ssr): preserve fetchModule error details #18626

Closed hi-ogawa closed 2 weeks ago

hi-ogawa commented 2 weeks ago

Description

While investigating the other fix https://github.com/vitejs/vite/pull/18621, I realized new transport (introduced in https://github.com/vitejs/vite/pull/18362) is not preserving some error properties such as RollupError.loc, frame, which is useful for error overlay.

Error overlay screenshots - main: https://stackblitz.com/edit/vitest-dev-vitest-ankaav?file=vite.config.ts ![image](https://github.com/user-attachments/assets/e3c59349-dd97-4d86-a0cc-55220e3abe84) - this PR: https://stackblitz.com/edit/vitest-dev-vitest-xtwqzr?file=vite.config.ts ![image](https://github.com/user-attachments/assets/3d59bc6c-5248-48c0-a128-e267162f51b7)
pkg-pr-new[bot] commented 2 weeks ago

Open in Stackblitz

pnpm add https://pkg.pr.new/vite@18626

commit: dd1a756