Repository navigation
fix: onError getting passed Error objects instead of strings - #12
Merged
Merged
Conversation
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.
Owner
|
thanks, dude, the markup catch is good, will be useful later :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
import { EditableText } from "react"which isnt a thing that exists, only hits if you call entryFor directly without stripping EditableText firstsmall diff, no behavior change for the normal path. tests pass.