Skip to content

fix: throw Error instead of raw array for TypeScript compilation failures#160

Closed
nikhiltelkar2005-glitch wants to merge 1 commit into
accordproject:mainfrom
nikhiltelkar2005-glitch:fix/compiler-error-object
Closed

fix: throw Error instead of raw array for TypeScript compilation failures#160
nikhiltelkar2005-glitch wants to merge 1 commit into
accordproject:mainfrom
nikhiltelkar2005-glitch:fix/compiler-error-object

Conversation

@nikhiltelkar2005-glitch

Copy link
Copy Markdown

Resolves #128

Problem:
When a template formula contained invalid TypeScript, TemplateMarkToJavaScriptCompiler.compile() threw a raw Array<CompilerError>. This meant that any caller catching this error received [object Object] without a .message or a stack trace, making the rich error information collected by Twoslash inaccessible.

Solution:
Wrapped the raw errors array into a proper standard JavaScript Error object. The new error message groups the compilation failures by their nodeId and maps out each individual issue with its corresponding line and column number, making the failures much easier for users to debug.

@nikhiltelkar2005-glitch
nikhiltelkar2005-glitch requested a review from a team June 9, 2026 11:02
…ures (accordproject#128)

Signed-off-by: Nikhil Telkar <nikhiltelkar2005@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open with no activity. Remove the stale label or comment to keep it active. Only items with maintainer engagement are auto-closed.

@github-actions github-actions Bot added the Stale label Jun 25, 2026
@dselman

dselman commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Duplicate of #162

@dselman dselman marked this as a duplicate of #162 Jul 3, 2026
@dselman dselman closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants