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

Older Browser Support - Safari iOS 14: 'SyntaxError: Unexpected private name #B. Cannot parse class method with private name' #699

Open
yuvalkamani opened this issue Nov 12, 2024 · 0 comments

Comments

@yuvalkamani
Copy link

Description

I'm encountering a syntax error when trying to use this library on Safari in iOS 14. If I try to load the Puck demo site, it fails to load and displays the following error: SyntaxError: Unexpected private name #B. Cannot parse class method with private name. I am getting a similar error in my project that uses Puck as well.

Environment

  • Device: iPhone 7 (iOS 14.6)
  • Browser: Safari
  • Library Version: 0.16.1
  • Framework: NextJS 15.0.3

Steps to Reproduce

  1. Open the app/demo website using Safari on iOS 14.
  2. Attempt to load the page where the library is used.
  3. Observe the syntax error in the console.

Expected Behavior

The app should load without syntax errors, even on older browsers like Safari on iOS 14.

Actual Behavior

The app fails to load, and the syntax error above is displayed.

Possible Cause

It appears that the library might be using JavaScript class private fields (e.g., #B), which aren't supported in older versions of Safari. According to browser compatibility documentation, private class fields are available in iOS 14.5+ Safari, but it still doesn't load.

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

1 participant