twitter / twitter-text

Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.
https://developer.twitter.com/en/docs/counting-characters
Apache License 2.0
3.07k stars 520 forks source link

autoLinkWithJSON is not a function #326

Open individual8 opened 4 years ago

individual8 commented 4 years ago

I've used twitter-text in my JS project before and for maintaining reasons updated the project today. twitter-text was updated from 3.0.1 to 3.1.0 as per package.json.

Now I get the following error: "twitterText.autoLinkWithJSON is not a function".

Obviously sth. has changed in the way the package works. I'm clueless what though. Any help appreciated.

koki-miyazaki commented 3 years ago

maybe same issue

Uncaught TypeError: twitter_text_1.parseTweet is not a function

It seems that's because package.json is a bit changed here https://github.com/twitter/twitter-text/pull/310/files#diff-e51a40ac250c9696142466f114f754161e7e5102c0cdb5354548b757deb272f6R6

  "module": "dist/esm",

I'm not sure why the line is added, but when I removed the line (which means we use dist/index.js, not dist/esm/index.js), there's no error