-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Advise which file failed to be transformed when RollupError: Unexpected character
occurs
#5246
Comments
Would be happy to raise a PR, but I'm not familiar the rollup codebase & logging implementation |
RollupError: Unexpected character
occursRollupError: Unexpected character
occurs
Looks like there was a regression at some point in time, previous logging informed where the error occurred: |
Rollup error objects contain all the information and I am quite sure Rollup CLI would print that information, but we are not the maintainers of SvelteKit. Also, it looks like you are not using a current version of Rollup as I think the error looks slightly different now. |
@lukastaegert You are correct, with the latest version of rollup, the problematic file is logged https://stackblitz.com/edit/stackblitz-starters-pwd7ao?file=README.md
I'll close this issue, thank you for looking into it |
I'm on Rollup 4.12.1, and all I see is
|
This is not the output of Rollup, this looks to me like the output of Vite. But you are right, maybe we should rewrite the error messages to include the location as several tools seem to be swallowing it |
Fix here #5424 |
This issue has been resolved via #5424 as part of rollup@4.13.0. You can test it via |
Still getting an unhelpful error when building with Vite + Rollup 4.13.0:
|
Then please provide a working reproduction. |
Thanks, I will if I can (large project). Until then FYI I get the path to the offending file printed in my terminal if I add to function getRollupError(base) {
+ console.log(base.id) |
Expected Behavior / Situation
When
RollupError: Unexpected character '' (Note that you need plugins to import files that are not JavaScript)
occurs, the file that failed to be transformed should be loggedActual Behavior / Situation
Logs currently look like below - notice that there is no indication as to which file caused the problem:
Modification Proposal
At the location where files are transformed, provide additional logging output when errors occur.
rollup/src/ModuleLoader.ts
Lines 322 to 325 in 52c55bb
The text was updated successfully, but these errors were encountered: