Skip to content

fix: onError getting passed Error objects instead of strings - #12

Merged
jamestitus299 merged 1 commit into
jamestitus299:masterfrom
premkumarsevugan:master
Sep 1, 2026
Merged

jamestitus299 merged 1 commit into
jamestitus299:masterfrom
premkumarsevugan:master

Conversation

@premkumarsevugan

Copy link
Copy Markdown
Contributor

onError is typed as a string callback but two spots in EditReactCanvas were just passing the raw Error object through. If transformJSXTextToEditableText or transformEditableTextToJSX throw, whatever renders the error msg blows up instead of showing it. There's already a spot a few lines below that does error instanceof Error ? error.message : String(error) correctly, just made the other two match it.

Also fixed while I was in the builder code:

  • importLines was emitting import { EditableText } from "react" which isnt a thing that exists, only hits if you call entryFor directly without stripping EditableText first
  • prerenderMarkup was waiting on bundleEntry/compileCss to finish before it even started even tho it doesnt need their output, now they just run together

small diff, no behavior change for the normal path. tests pass.

two spots in EditReactCanvas passed the Error straight through even
tho onError expects a string, so anything rendering it would crash.
matched the existing instanceof Error check a few lines below.

also fixed importLines emitting a bogus react import for EditableText,
and made prerenderMarkup run alongside bundleEntry/compileCss instead
of after.
@jamestitus299 jamestitus299 self-assigned this Aug 31, 2026
@jamestitus299 jamestitus299 added the enhancement New feature or request label Aug 31, 2026
@jamestitus299

Copy link
Copy Markdown
Owner

thanks, dude, the markup catch is good, will be useful later :)

@jamestitus299
jamestitus299 merged commit 93b7ce1 into jamestitus299:master Sep 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants