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

fix: parseObject error causes website broken #848

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

await-ovo
Copy link
Contributor

Summary

fix #847
I'm sorry, this PR crashed the website playground.

const parseObject = (value) =>
  value.split(',').reduce((obj, assignment) => {
    const [left, right] = assignment.split('=')
    return {
      ...obj,
      [left.trim()]: right.trim(),
    }
  }, {})

right in the above function may be undefined, so parseObject will throw an error.

Curious why the error is not visible in the console

Test plan

The playground works even if REPLACE ATTRIBUTES VALUE or SVG PROPS are not set:

image

@vercel
Copy link

vercel bot commented Apr 3, 2023

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

Name Status Preview Comments Updated (UTC)
svgr ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 3, 2023 2:40pm

@await-ovo
Copy link
Contributor Author

cc @gregberge

@await-ovo
Copy link
Contributor Author

I'm not sure why the CI is reporting errors, in my local npm run build looks fine

Copy link

@rhuangabrielsantos rhuangabrielsantos left a comment

Choose a reason for hiding this comment

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

Please, merge this PR @gregberge

@gregberge gregberge merged commit 60bb15f into gregberge:main Apr 5, 2023
5 of 9 checks passed
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.

Website is broken
3 participants