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
warn
parameter is not compatible with Error
anymore
#4754
Comments
The Could you please describe in words that have more information than "does not work" what exactly is not working for your when you pass an error as a warning? Is it just a TypeScript issue? It works, but the CLI output is not what you expect? Something else? If it is a TypeScript error, does it work when you cast to Changing errors back is not really an option, this was a big refactoring to unify and simplify many errors and warnings in Rollup 3, so some issues for plugins cannot be avoided, unfortunately. |
The message is: Argument of type 'Error' is not assignable to parameter of type 'string | RollupLog'.
Type 'Error' is not assignable to type 'RollupLog'.
Types of property 'cause' are incompatible.
Type 'unknown' is not assignable to type 'Error | undefined'.ts(2345) Oh, so it's not the In interface Error {
cause?: unknown;
} When I manipulate @lukastaegert Would this be an allowed modification to Rollup? This change would fulfill my
|
If |
This issue has been resolved via #4757 as part of rollup@3.7.5. You can test it via |
Expected Behavior / Situation
I need to update one of my plugins from Vite 3 to 4 and therefore the underlying Rollup version was migrated to v3
Previously it was possible to pass an error to a Rollup
warn
call.https://github.com/Shinigami92/vite-plugin-time-reporter/pull/26/files#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R43
Now this is not the case anymore 🙁
Actual Behavior / Situation
There was a change that changed the
RollupLog['name']
property tonames
rollup/src/rollup/types.d.ts
Line 35 in e315ffc
https://github.com/rollup/rollup/pull/4579/files#diff-2651238122dc82e0e84b4e3cb1499b8cbd4c01a21a36c9c2fae5812e95cd8ec8L35-R26
This might result in that
RollupLog
is now not anymore compatible with theError
interfaceModification Proposal
Could we change it back to accept
Error
forwarn
calls?This could help in that many Vite plugins out there that are just "simple" can just support Vite 2, 3 and 4 without any runtime changes and therefore don't need to introduce a breaking change just for a warn call.
The text was updated successfully, but these errors were encountered: