Skip to content
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

Update parseImage.ts #329

Closed
wants to merge 1 commit into from
Closed

Conversation

vikiival
Copy link
Contributor

Context

Back in Feb 2024 I was able to use arraybuffer a image src

Now I am getting this fancy error

TypeError: src.startsWith is not a function at parseImage

Fix

Skip src.startsWith when it is not a string

Copy link

vercel bot commented May 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frog ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 1:44pm
frog-frame ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 1:44pm

Copy link

vercel bot commented May 20, 2024

@vikiival is attempting to deploy a commit to the wevm Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines +57 to +58
const isPath = typeof src === 'string' && src.startsWith('/')
if (isPath) node.props.src = `${assetsUrl + parsePath(src)}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think that anything other than string is expected here.

Copy link
Collaborator

@dalechyn dalechyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering your provided example, I'd suggest to try convert that image to base64 format and passing it as

src={`url("data:image/png;base64,{base64EncodedImage}")`}

@dalechyn
Copy link
Collaborator

dalechyn commented Jun 6, 2024

closing this as stale. please consider reopening if needed.

@dalechyn dalechyn closed this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants