# When Embedding tweet sometimes get Unexpected exception

**URL:** <https://forum.umbraco.com/t/when-embedding-tweet-sometimes-get-unexpected-exception/6764>\
**Category:** Questions\
**Tags:** packages, v16\
**Created:** [November 25, 2025, 9:48pm UTC](https://forum.umbraco.com/t/when-embedding-tweet-sometimes-get-unexpected-exception/6764 "2025-11-25T21:48:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eaglef90](https://forum.umbraco.com/user_avatar/forum.umbraco.com/eaglef90/32/1014_2.png) [@Eaglef90](https://forum.umbraco.com/u/Eaglef90)\
**Post date:** [November 25, 2025, 9:48pm UTC](https://forum.umbraco.com/t/when-embedding-tweet-sometimes-get-unexpected-exception/6764/1 "2025-11-25T21:48:56Z")

</div>

Every few weeks, when I try to embed a tweet in an RTE using the built-in Embed function, it fails, no matter which tweet I choose, with an “Unexpected exception happened while trying to get oembed markup” error. I am using the TinyMCE package on my v16 install, so I don’t know if this is a core issue, a package issue, or a Twitter issue, and how to deal with it. Does anyone have any ideas? Here is the error stack

```auto
System.Text.Json.JsonException: 'e' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.

 ---> System.Text.Json.JsonReaderException: 'e' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.

   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)

   at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)

   at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)

   at System.Text.Json.Utf8JsonReader.ReadSingleSegment()

   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)

   --- End of inner exception stack trace ---

   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)

   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)

   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)

   at Umbraco.Cms.Infrastructure.Serialization.SystemTextJsonSerializerBase.Deserialize[T](String input)

   at Umbraco.Cms.Core.Media.EmbedProviders.OEmbedProviderBase.GetJsonResponseAsync[T](String url, CancellationToken cancellationToken)

   at Umbraco.Cms.Core.Media.EmbedProviders.OEmbedProviderBase.GetJsonBasedMarkupAsync(String url, Nullable`1 maxWidth, Nullable`1 maxHeight, CancellationToken cancellationToken)

   at Umbraco.Cms.Core.Media.EmbedProviders.X.GetMarkupAsync(String url, Nullable`1 maxWidth, Nullable`1 maxHeight, CancellationToken cancellationToken)

   at Umbraco.Cms.Core.Services.OEmbedService.GetMarkupAsync(Uri url, Nullable`1 maxWidth, Nullable`1 maxHeight, CancellationToken cancellationToken)

```

---

<div class="post-metadata">

**Author:** ![Eaglef90](https://forum.umbraco.com/user_avatar/forum.umbraco.com/eaglef90/32/1014_2.png) [@Eaglef90](https://forum.umbraco.com/u/Eaglef90)\
**Post date:** [November 29, 2025, 9:44am UTC](https://forum.umbraco.com/t/when-embedding-tweet-sometimes-get-unexpected-exception/6764/3 "2025-11-29T09:44:14Z")

</div>

Does anyone have any ideas on this? When it breaks it litterly stops work for the day. It will fix it’s self by the next day but losing a day of work because of the problem is costly

---

<div class="post-metadata">

**Author:** ![protherj](https://forum.umbraco.com/user_avatar/forum.umbraco.com/protherj/32/200_2.png) [@protherj](https://forum.umbraco.com/u/protherj)\
**Post date:** [December 10, 2025, 4:29pm UTC](https://forum.umbraco.com/t/when-embedding-tweet-sometimes-get-unexpected-exception/6764/4 "2025-12-10T16:29:20Z")

</div>

Hi Matthew, sorry I didn’t see this. Would it be possible to post an issue on the package issue tracker here?

> **[ProWorksCorporation/TinyMCE-Umbraco](https://github.com/ProWorksCorporation/TinyMCE-Umbraco/issues)**
>
> This Umbraco CMS package enables access to the TinyMCE-based Rich Text Editor (RTE) in version 16 and above. It also supports the use of TinyMCE Premium plugins with a valid subscription. Additiona...

I can take a look and see if I can reproduce it or figure out what is going on here

Thanks,  
Jason

---

<div class="post-metadata">

**Author:** ![Eaglef90](https://forum.umbraco.com/user_avatar/forum.umbraco.com/eaglef90/32/1014_2.png) [@Eaglef90](https://forum.umbraco.com/u/Eaglef90)\
**Post date:** [December 11, 2025, 1:25am UTC](https://forum.umbraco.com/t/when-embedding-tweet-sometimes-get-unexpected-exception/6764/5 "2025-12-11T01:25:42Z")

</div>

Hi Jason,

I ended up opening a bug report on the CMS github page and they found it was a bug in the twitter embed provider which they have fixed so I am all set but thank you.

---

<div class="post-metadata">

**Author:** ![protherj](https://forum.umbraco.com/user_avatar/forum.umbraco.com/protherj/32/200_2.png) [@protherj](https://forum.umbraco.com/u/protherj)\
**Post date:** [December 19, 2025, 8:40pm UTC](https://forum.umbraco.com/t/when-embedding-tweet-sometimes-get-unexpected-exception/6764/6 "2025-12-19T20:40:16Z")

</div>

Thanks! Could you link me to the issue?

---

<div class="post-metadata">

**Author:** ![Eaglef90](https://forum.umbraco.com/user_avatar/forum.umbraco.com/eaglef90/32/1014_2.png) [@Eaglef90](https://forum.umbraco.com/u/Eaglef90)\
**Post date:** [December 19, 2025, 9:15pm UTC](https://forum.umbraco.com/t/when-embedding-tweet-sometimes-get-unexpected-exception/6764/7 "2025-12-19T21:15:40Z")

</div>

Sure, here is the GitHub issue.

> <https://github.com/umbraco/Umbraco-CMS/issues/21052>
>
> \### Which Umbraco version are you using?
> 
> 16.4
> 
> \### Bug summary
> 
> When I try to e…mbed a tweet in an RTE using the built-in Embed function, it randomly fails, no matter which tweet I choose, with an “Unexpected exception happened while trying to get oembed markup” error. I am using the TinyMCE package on my v16 install, so I don’t know if this is a core issue, a package issue, or a Twitter issue, but what was happening every few weeks is now happening almost daily to me and it is blocking articles from getting published.
> 
> \### Specifics
> 
> URLs trying to embed:
> 
> https://x.com/THR/status/1995620384344080849?s=20
> https://x.com/SquareEnix/status/1995780120888705216?s=20
> https://x.com/sem\_sep/status/1991750339427700739?s=20
> https://x.com/sem\_sep/status/1991749404114767914?s=20
> 
> Error generated:
> 
> \`System.Text.Json.JsonException: 'e' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
> 
> ---\> System.Text.Json.JsonReaderException: 'e' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
> 
> at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan\`1 bytes)
> 
> at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
> 
> at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
> 
> at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
> 
> at System.Text.Json.Serialization.JsonConverter\`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
> 
> This happens on multiple computers using different browsers on different ISPs (I have tried it from my laptop on my T-Mobile hotspot, my laptop at home on a Fiber connection, and my employee gets it from their desktop at their home on the other side of the USA)
> 
> --- End of inner exception stack trace ---
> 
> at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
> 
> at System.Text.Json.Serialization.JsonConverter\`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
> 
> at System.Text.Json.JsonSerializer.ReadFromSpan\[TValue\](ReadOnlySpan\`1 json, JsonTypeInfo\`1 jsonTypeInfo)
> 
> at Umbraco.Cms.Infrastructure.Serialization.SystemTextJsonSerializerBase.Deserialize\[T\](String input)
> 
> at Umbraco.Cms.Core.Media.EmbedProviders.OEmbedProviderBase.GetJsonResponseAsync\[T\](String url, CancellationToken cancellationToken)
> 
> at Umbraco.Cms.Core.Media.EmbedProviders.OEmbedProviderBase.GetJsonBasedMarkupAsync(String url, Nullable\`1 maxWidth, Nullable\`1 maxHeight, CancellationToken cancellationToken)
> 
> at Umbraco.Cms.Core.Media.EmbedProviders.X.GetMarkupAsync(String url, Nullable\`1 maxWidth, Nullable\`1 maxHeight, CancellationToken cancellationToken)
> 
> at Umbraco.Cms.Core.Services.OEmbedService.GetMarkupAsync(Uri url, Nullable\`1 maxWidth, Nullable\`1 maxHeight, CancellationToken cancellationToken)\`
> 
> \### Steps to reproduce
> 
> In the RTE, click the "embed" function from the toolbar menu.
> Enter one of the URLs provided
> Click "retrieve"
> Get error
> 
> \### Expected result / actual result
> 
> I would expect the function to work and return the proper code and embed the tweet vs. throwing errors.
