GSAP icon indicating copy to clipboard operation
GSAP copied to clipboard

SplitText Plugin Throws Error "Intl.Segmenter is not a constructor" in Older Browser Versions

Open ahzvenol opened this issue 5 months ago • 4 comments

Tested Browser Version: Chromium 86.0.4236.0

The issue originates from line 71 in SplitText.ts: _charSegmenter: any = typeof Intl !== "undefined" ? new (Intl as any).Segmenter() : 0 In the tested browser, Intl exists but Intl.Segmenter does not, leading to an exception being thrown.

ahzvenol avatar Aug 10 '25 11:08 ahzvenol

Interesting. What browser/version was giving you trouble? We can add another conditional check in the next version.

jackdoyle avatar Aug 10 '25 23:08 jackdoyle

I tested multiple Chrome versions between 56 and 86, and also Firefox 120. According to the MDN documentation, browsers/versions that support Intl but not Intl.Segmenter may be affected.

ahzvenol avatar Aug 11 '25 14:08 ahzvenol

I encountered the same problem.

Dev-Dongfang avatar Aug 14 '25 12:08 Dev-Dongfang

I temporarily added a conditional judgment to solve the problem, and I hope the GSAP can support it in the future. Image

Dev-Dongfang avatar Aug 14 '25 12:08 Dev-Dongfang

SplitText is still causing issues on older FF versions (tested on 120, 125)

yannick-mir avatar Nov 17 '25 09:11 yannick-mir

We've got this fixed in the next release which we hope to launch in the next 2-3 weeks.

jackdoyle avatar Nov 17 '25 16:11 jackdoyle