Repository navigation
fix(napi/transform): correct error messages for compile options - #30280
overlookmotel merged 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
9b245ea to
062cee7
Compare
062cee7 to
4302ea8
Compare
Merging this PR will not alter performanceWarning oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.
Comparing Footnotes
|
Pins the decorators-lowering head restacked onto oxc main 746ad93f. Snapshot changes from oxc main: - ts_experimental_decorators: computed keys of decorated `declare` fields are evaluated and passed to __decorate again (oxc-project/oxc#30264). - ts_declare_class_fields: keys of `declare` fields are no longer evaluated, as tsc and esbuild do (oxc-project/oxc#30272). - invalid_define_config/value: the error names the key and value (oxc-project/oxc#30280).
transformandtransformSyncreported errors in the options (e.g. a syntax error in the value of adefine) with a code frame. The code frame was rendered against the source text of the file being transformed. But the position of such an error is an offset into the option's value, not into the source text. So the code frame pointed at unrelated code, and was misleading.Input:
Before output:
After output:
The error is at offset 3 of the define's value
1 +. Before, that offset was looked up in the file, which is why the code frame pointed at line 1, column 4 ofa.js.Now options errors have no code frame, only the message, and the message says which
definethe problem is in.It'd be ideal to produce a codeframe showing the
define's value, but that would require much more intrusive changes, asOxcDiagnosticdoesn't support providing source text.