Skip to content
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 (?.) is not supported in IE and other old browsers #368

Closed
lvxiaodi1234 opened this issue Jun 7, 2023 · 2 comments

Comments

@lvxiaodi1234
Copy link

In error log monitor,I found some errors like "Uncaught SyntaxError: Unexpected token ." from old browsers(IE and so on).
image

Debug file "base.js", the problem is optional chaining operator (?.) can not use directly in old browsers
image

@sindresorhus
Copy link
Owner

From the top of the readme:

For browser usage, this package targets the latest version of Chrome, Firefox, and Safari.

@thomasjm
Copy link

thomasjm commented Jun 8, 2023

Using this operator seems to confuse terser for versions < 5.2.0: terser/terser#567

Some parts of the ecosystem still use an older terser, so I think it would be better not to use the optional chaining operator in libraries.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants