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

fix(ssr): format ssrTransform parse error #18621

Closed

Conversation

hi-ogawa
Copy link
Collaborator

@hi-ogawa hi-ogawa commented Nov 8, 2024

Description

It looks like this parse error handling code is obsolete and does nothing for current rollup parse error. For non-js file, esbuild transform in plugin pipeline normally catches a syntax error, but for js file, ssrTransform needs to throw an error. Since ssrTransform is outside of transform plugin pipeline, Error.pos doesn't get prettified automatically, so I added a error processing inside the try/catch.

reproduction: https://stackblitz.com/edit/vitest-dev-vitest-wpj5mg?file=vite.config.ts

Screenshots
  • v5

image

  • this PR

image

Copy link

pkg-pr-new bot commented Nov 8, 2024

Open in Stackblitz

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

commit: 6b0ea32

@hi-ogawa hi-ogawa force-pushed the fix-format-ssr-transform-parse-error branch from 15c13f7 to db31543 Compare November 9, 2024 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log LOC for js syntax errors
1 participant