-
Notifications
You must be signed in to change notification settings - Fork 258
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
generation works only once: [Error] TypeError: Cannot read properties of undefined (reading '0') #650
Comments
I managed to fix by setting base64 encoded image data in href of |
Here's a reproduction in the playground. Making an update in the code (e.g. adding a space somewhere) will trigger this error:
The browser console traces back to here: The relevant lines are here: satori/src/handler/preprocess.ts Lines 119 to 130 in 1481902
|
This mainly has to do with how
I think the most straightforward solution would be to clear the map of inflight requests along with the cache clear. |
Closes #650 ## Current behavior Try changing the background color in the `main` [playground link](https://og-playground.vercel.app/?share=7VVdb9owFP0rlvfSScH5BEIEnVZUqZ3UrZ2qTZN4CYmTmDpxZhsCQ_z33XxBqvVp2uOMUHyvj-899_o4OeJIxBQHeB6z3apASOkDp4vjsZ4jFDNV8vAQoBVOON2vsNH6N1ulWXJYikLTQtfLETypPANCztLiXtNcvVpE7WrFYp0FyLasDp5RlmYQ5-JZh9FLKsW2iJeCC1lH0TIsVBlKCNblOZ1WxXU9matdOgi9OEIgWLuEHnp2jFY3Yr9YYQtZyHbHZDbzfB_ZzoRMYExXuAXuc14ogGVal4FpVlVFKpcImZqOZVlmnbNBNhSAREwT1c3BijgrH0OdIRZDDADXxgqfAQApa8_ZRKipMBEyhw15qCXbX9nEbYdhwW90Mf0x8WzLn0wMp2ENvN_3xNtRp80RbEMZGkFttoMiNPKJPfXAN7LHZOpMjZFH3IkN5oz4tgcZbOJ5iIPDJdbEGDkQvtnoEcsH-JRY09nZgiC-ZUOSGgc95NDPwbYlAG3ie4D0obkubHQ94swgzwxyNqSa6R2cRIR6bh21lllHrOfVxu9ZtTRaTu38zKgn1BXSE3pddp8RujRs3vXcrM_mcphmf5r9WZuDw56zPExpj80kTTrRKFBNEirND6RkkdrmpMyEFspksemM_VpGpmtZZFOmH7I8jBaP019bb3bzqXq6u9t8vp08OvffHKofnp65-LJ2ntY8_-mz_XL00EnvTcm_JXqESkkVlTv6UZU00l9DzQTQ3D-w-Af8keIsopegfb0A2Up-9a7T71li0KGm6r4FQyknjHPYV4hiEFBpKV4ouKuM6T_839saxme2_-4q_L8Gf3UNhldgXr_rYAaqZ7trbGBRgnoKhYMjbtSHAx_e3LiVHQ682ojpepviIAm5ogamudiw50NZf2t01VgQJ4EPyG2-pjEOtNzSk4F1uAZERjkXlZA8xqff). See this comment for [explanation](#650 (comment)) of why this is happening. ## Proposed behavior Try changing the background color in this branch's [playground link](https://satori-playground-git-fork-erxclau-clear-image-inflight-6f2758.vercel.sh/?share=7VVdb9owFP0rlvfSScH5BEIEnVZUqZ3UrZ2qTZN4CYmTmDpxZhsCQ_z33XxBqvVp2uOMUHyvj-899_o4OeJIxBQHeB6z3apASOkDp4vjsZ4jFDNV8vAQoBVOON2vsNH6N1ulWXJYikLTQtfLETypPANCztLiXtNcvVpE7WrFYp0FyLasDp5RlmYQ5-JZh9FLKsW2iJeCC1lH0TIsVBlKCNblOZ1WxXU9matdOgi9OEIgWLuEHnp2jFY3Yr9YYQtZyHbHZDbzfB_ZzoRMYExXuAXuc14ogGVal4FpVlVFKpcImZqOZVlmnbNBNhSAREwT1c3BijgrH0OdIRZDDADXxgqfAQApa8_ZRKipMBEyhw15qCXbX9nEbYdhwW90Mf0x8WzLn0wMp2ENvN_3xNtRp80RbEMZGkFttoMiNPKJPfXAN7LHZOpMjZFH3IkN5oz4tgcZbOJ5iIPDJdbEGDkQvtnoEcsH-JRY09nZgiC-ZUOSGgc95NDPwbYlAG3ie4D0obkubHQ94swgzwxyNqSa6R2cRIR6bh21lllHrOfVxu9ZtTRaTu38zKgn1BXSE3pddp8RujRs3vXcrM_mcphmf5r9WZuDw56zPExpj80kTTrRKFBNEirND6RkkdrmpMyEFspksemM_VpGpmtZZFOmH7I8jBaP019bb3bzqXq6u9t8vp08OvffHKofnp65-LJ2ntY8_-mz_XL00EnvTcm_JXqESkkVlTv6UZU00l9DzQTQ3D-w-Af8keIsopegfb0A2Up-9a7T71li0KGm6r4FQyknjHPYV4hiEFBpKV4ouKuM6T_839saxme2_-4q_L8Gf3UNhldgXr_rYAaqZ7trbGBRgnoKhYMjbtSHAx_e3LiVHQ682ojpepviIAm5ogamudiw50NZf2t01VgQJ4EPyG2-pjEOtNzSk4F1uAZERjkXlZA8xqff). ## Related This is related to #593 and #592 (#592 (comment) and #592 (comment)). The error in #592 is no longer thrown, though the image still does not render in PNG mode ([link](https://satori-playground-git-fork-erxclau-clear-image-inflight-6f2758.vercel.sh/?share=7VVdb9owFP0rlvfSScH5BEIEnVZUqZ3UrZ2qTZN4CYmTmDpxZhsCQ_z33XxBqvVp2uOMUHyvj-899_o4OeJIxBQHeB6z3apASOkDp4vjsZ4jFDNV8vAQoBVOON2vsNH6N1ulWXJYikLTQtfLETypPANCztLiXtNcvVpE7WrFYp0FyLasDp5RlmYQ5-JZh9FLKsW2iJeCC1lH0TIsVBlKCNblOZ1WxXU9matdOgi9OEIgWLuEHnp2jFY3Yr9YYQtZyHbHZDbzfB_ZzoRMYExXuAXuc14ogGVal4FpVlVFKpcImZqOZVlmnbNBNhSAREwT1c3BijgrH0OdIRZDDADXxgqfAQApa8_ZRKipMBEyhw15qCXbX9nEbYdhwW90Mf0x8WzLn0wMp2ENvN_3xNtRp80RbEMZGkFttoMiNPKJPfXAN7LHZOpMjZFH3IkN5oz4tgcZbOJ5iIPDJdbEGDkQvtnoEcsH-JRY09nZgiC-ZUOSGgc95NDPwbYlAG3ie4D0obkubHQ94swgzwxyNqSa6R2cRIR6bh21lllHrOfVxu9ZtTRaTu38zKgn1BXSE3pddp8RujRs3vXcrM_mcphmf5r9WZuDw56zPExpj80kTTrRKFBNEirND6RkkdrmpMyEFspksemM_VpGpmtZZFOmH7I8jBaP019bb3bzqXq6u9t8vp08OvffHKofnp65-LJ2ntY8_-mz_XL00EnvTcm_JXqESkkVlTv6UZU00l9DzQTQ3D-w-Af8keIsopegfb0A2Up-9a7T71li0KGm6r4FQyknjHPYV4hiEFBpKV4ouKuM6T_839saxme2_-4q_L8Gf3UNhldgXr_rYAaqZ7trbGBRgnoKhYMjbtSHAx_e3LiVHQ682ojpepviIAm5ogamudiw50NZf2t01VgQJ4EPyG2-pjEOtNzSk4F1uAZERjkXlZA8xqff)).
🎉 This issue has been resolved in version 0.12.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [satori](https://redirect.github.com/vercel/satori) | [`0.12.0` -> `0.12.1`](https://renovatebot.com/diffs/npm/satori/0.10.13/0.12.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/satori/0.12.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/satori/0.12.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/satori/0.10.13/0.12.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/satori/0.10.13/0.12.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vercel/satori (satori)</summary> ### [`v0.12.1`](https://redirect.github.com/vercel/satori/releases/tag/0.12.1) [Compare Source](https://redirect.github.com/vercel/satori/compare/0.12.0...0.12.1) ##### Bug Fixes - clear inflight request map for image resolution ([#​651](https://redirect.github.com/vercel/satori/issues/651)) ([57a89ea](https://redirect.github.com/vercel/satori/commit/57a89ea6b1a4fdf3c273b4f6d4f384fa02cacc5c)), closes [#​650](https://redirect.github.com/vercel/satori/issues/650) [/github.com/vercel/satori/issues/650#issuecomment-2506776490](https://redirect.github.com//github.com/vercel/satori/issues/650/issues/issuecomment-2506776490) [#​593](https://redirect.github.com/vercel/satori/issues/593) [#​592](https://redirect.github.com/vercel/satori/issues/592) [/github.com/vercel/satori/issues/592#issuecomment-1979586066](https://redirect.github.com//github.com/vercel/satori/issues/592/issues/issuecomment-1979586066) [/github.com/vercel/satori/issues/592#issuecomment-1979590654](https://redirect.github.com//github.com/vercel/satori/issues/592/issues/issuecomment-1979590654) [#​592](https://redirect.github.com/vercel/satori/issues/592) ### [`v0.12.0`](https://redirect.github.com/vercel/satori/releases/tag/0.12.0) [Compare Source](https://redirect.github.com/vercel/satori/compare/0.11.3...0.12.0) ##### Features - add ability to add text stroke ([#​645](https://redirect.github.com/vercel/satori/issues/645)) ([1481902](https://redirect.github.com/vercel/satori/commit/14819024d4d9a38509656329877f200a753d504a)), closes [#​578](https://redirect.github.com/vercel/satori/issues/578) ### [`v0.11.3`](https://redirect.github.com/vercel/satori/releases/tag/0.11.3) [Compare Source](https://redirect.github.com/vercel/satori/compare/0.11.2...0.11.3) ##### Bug Fixes - background-clip:text should compatible with transform and mask ([#​639](https://redirect.github.com/vercel/satori/issues/639)) ([11575c9](https://redirect.github.com/vercel/satori/commit/11575c9811e396bf88a83d8e158c639a0944b1c8)) ### [`v0.11.2`](https://redirect.github.com/vercel/satori/releases/tag/0.11.2) [Compare Source](https://redirect.github.com/vercel/satori/compare/0.11.1...0.11.2) ##### Bug Fixes - textDecoration should compatible with transform ([#​640](https://redirect.github.com/vercel/satori/issues/640)) ([618d565](https://redirect.github.com/vercel/satori/commit/618d565edb83270d9b829edc430788032e6f2bc6)) ### [`v0.11.1`](https://redirect.github.com/vercel/satori/releases/tag/0.11.1) [Compare Source](https://redirect.github.com/vercel/satori/compare/0.11.0...0.11.1) ##### Bug Fixes - clipping behavior of children with transform ([#​635](https://redirect.github.com/vercel/satori/issues/635)) ([c55e4da](https://redirect.github.com/vercel/satori/commit/c55e4da1f5a66edc906f3ab5f901efff4b7cd6f2)) ### [`v0.11.0`](https://redirect.github.com/vercel/satori/releases/tag/0.11.0) [Compare Source](https://redirect.github.com/vercel/satori/compare/0.10.14...0.11.0) ##### Features - support `repeating-linear-gradient` ([#​630](https://redirect.github.com/vercel/satori/issues/630)) ([ff80448](https://redirect.github.com/vercel/satori/commit/ff80448924541575bfd72c179a5ceb199912a9cf)), closes [#​624](https://redirect.github.com/vercel/satori/issues/624) ### [`v0.10.14`](https://redirect.github.com/vercel/satori/releases/tag/0.10.14) [Compare Source](https://redirect.github.com/vercel/satori/compare/0.10.13...0.10.14) ##### Bug Fixes - incorrect data URL parsing ([#​596](https://redirect.github.com/vercel/satori/issues/596)) ([965b3a1](https://redirect.github.com/vercel/satori/commit/965b3a12a28ab624d55246f17bebc5d9b90f35a2)), closes [#​597](https://redirect.github.com/vercel/satori/issues/597) [/www.rfc-editor.org/rfc/rfc2397#section-3](https://redirect.github.com//www.rfc-editor.org/rfc/rfc2397/issues/section-3) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/X-oss-byte/Nextjs).
Bug report
Description / Observed Behavior
I'm using satori in nodejs environment and the svg generation only works once then it gives an error
Expected Behavior
It should generate svg
Here's the code snippet to regenerate the issue
Additional Context
"satori": "^0.12.0"
The text was updated successfully, but these errors were encountered: