saurabhnemade / react-twitter-embed

Simplest way to add twitter widgets to your react project.
https://saurabhnemade.github.io/react-twitter-embed/
363 stars 66 forks source link

MIME type mismatch for TwitterTweetEmbed #31

Closed brentmc79 closed 5 years ago

brentmc79 commented 5 years ago

Getting the following error in the Chrome console when I attempt to render an embedded tweet:

Refused to execute script from 'https://cdn.syndication.twimg.com/tweets.json?callback=__twttr.callbacks.cb0&ids=zYthtQaw&lang=en&suppress_response_codes=true&theme=light&tz=GMT-0700' because its MIME type ('') is not executable, and strict MIME type checking is enabled.

Here is the code snippet:

<TwitterTweetEmbed tweetId="zYthtQaw"/>

mihir0x69 commented 5 years ago

Can confirm! Any update on this?

mihir0x69 commented 5 years ago

I didn't use this library, but I think the error was because of a leading / in tweetId.

brentmc79 commented 5 years ago

I realized that it was a problem with the string id that I was attempting to use. It was the uid from the shortened tweet url, which isn’t the actual tweet id. As soon as I used a valid id everything worked as expected.