Skip to content

Conversation

@hi-ogawa
Copy link
Contributor

@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

@pkg-pr-new
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
@hi-ogawa hi-ogawa marked this pull request as ready for review November 9, 2024 03:43
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