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

Safari support <=13 is completely broken. #637

Closed
l-you opened this issue Jun 28, 2023 · 3 comments
Closed

Safari support <=13 is completely broken. #637

l-you opened this issue Jun 28, 2023 · 3 comments

Comments

@l-you
Copy link

l-you commented Jun 28, 2023

We use react-intersection-observer in our NextJS app.
Recently, we discovered that our website is broken in all Safari browsers prior to iOS 13.4.

The root of the problem is that ES2020 features (such a constructor and ()=>{} syntax) are omitted in the production code.
Browser: IOS Safari 13.4
Device: All IPhones
Testing source: Browserstack

Question is:
Is it expected behaviour to omit the latest ESM features in the react-intersection-observer?
If so, why is it not specified in the documentation?

For those who are looking for solution.
You can work around it by using the transpilePackages field in next.config.js.

Screenshot below shows code included in our NextJS bundle.
Screenshot 2023-06-28 at 14 15 11

Screenshot of browser console.

Screenshot 2023-06-28 at 14 14 40
@thebuilder
Copy link
Owner

Could you try the latest release? It downgrades the bundle output to ES2018, which should also fix this.
#635

@thebuilder
Copy link
Owner

Is it expected behaviour to omit the latest ESM features in the react-intersection-observer?

The question is what baseline target should be supported in packages. There's no definite answer to this.

@thebuilder
Copy link
Owner

Fixed by #636

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

2 participants