-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Optional chaining operator not supported in older browsers #344
Comments
Hey @alexloi! 👋 If you upgrade to import { twMerge } from 'tailwind-merge/es5' to use a version of the bundle that does not use optional chaining. Related: #341 (comment) |
There is any chance that "regular" import doesn't generate this error on older browsers? Mostly because of the bundle size increment that I've read on #341 (comment). |
Hey @emmgfx! 👋 Unfortunately no. Older browsers don't have some JS features which means that we need to ship some extra code to work around those missing features. Currently tailwind-merge ships 0.23 kB more over the wire when compressed with Brotli for the ES5 build. |
I expect that this issue is resolved and am closing it. Please let me know if I should reopen. |
Describe the bug
App setup:
Node 18.15.0
Next.js 13.4.10
Tailwind-merge: 1.14.0
Environment: Production
User journey:
The use of the optional chaining operator (?.) seems to be causing the problem.
To Reproduce
Would require to load up a sample app with the code above in a legacy environment as described.
Expected behavior
Code should be compatible with older browsers, perhaps some kind of workaround for the optional chaining operator being used
Additional context
I understand that there might not be the intention of supporting older browsers, in which case any tip or suggestion you may have that I could use to fix the issue on my side somehow I'd love to hear it 👍
Thank you for all the work you've done on tailwind-merge 🚀
The text was updated successfully, but these errors were encountered: