-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Internal rollup crash when transform generates invalid js #13571
Comments
Start a new pull request in StackBlitz Codeflow. |
Should this be reported to Rollup instead? The code where it errors is at https://github.com/rollup/rollup/blob/833314c1621420e031340c1894e7863e062f7761/src/utils/error.ts#L50 |
Rollup has a problematic code path, but the root of the problem is somehow vite now allowing rollup to get the updated currentSource across transforms, so the error is augmented incorrectly. I cant reproduce this issue only with rollup. |
The fix in rollup: would prevent the crash, but it would silence completely the error augmentation |
Describe the bug
When a plugin incorrectly transform JS code into invalid JS code, instead of showing the actual parsing error. It makes rollup crash in the error augmentation code.
Seems like an bug shared between rollup and vite. The error augmentation code should use the sourceCode as the last transform. Not the original source code.
Reproduction
https://stackblitz.com/edit/vitejs-vite-5cun7m?file=main.js,integrations.vscode.userData.settingsRaw,vite.config.js,counter.js,index.html&terminal=dev
Steps to reproduce
pnpm run build
System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.4.2 - /usr/local/bin/npm npmPackages: vite: ^4.3.9 => 4.3.9
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: