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

Remix causes syntax errors in iOS 11 #4762

Closed
jfsiii opened this issue Dec 3, 2022 · 3 comments
Closed

Remix causes syntax errors in iOS 11 #4762

jfsiii opened this issue Dec 3, 2022 · 3 comments
Labels
bug:unverified duplicate This issue or pull request already exists

Comments

@jfsiii
Copy link

jfsiii commented Dec 3, 2022

What version of Remix are you using?

1.8

Steps to Reproduce

Visit a Remix app in iOS 11

e.g. create one with npx create-remix@latest and browse it on https://browserstack.com

Expected Behavior

The site looks and functions as normal. No JS errors in the console

Screenshot 2022-12-03 at 8 53 26 AM

Why do I expect this?

https://remix.run/docs/en/v1/guides/browser-support says

Remix only runs in browsers that support ES Modules.

The linked page shows iOS on Safari supports ES Modules as of version 11.0
Screenshot 2022-12-03 at 8 14 42 AM

Actual Behavior

I'm having a hard time finding an 11.0 browser for testing but there are syntax errors in both 11.2 and 11.3

iOS 11.3

JS Syntax error in the console (from optional chaining?)

Screenshot 2022-12-03 at 9 25 18 AM

I believe this is from the optional chaining operator (which [isn't in Safari until 13.4](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining#browser_compatibility)) Screenshot 2022-12-03 at 9 24 54 AM

https://github.com/search?q=repo%3Aremix-run%2Fremix+%22%3F.data%22+path%3A%2F%5Epackages%5C%2F%2F&type=code&l=packages%2F

https://github.com/search?q=repo%3Aremix-run%2Fremix+%22%3F.formMethod%22+path%3A%2F%5Epackages%5C%2F%2F&type=code&l=packages%2F

iOS 11.2

JS Syntax error in the console (from optional catch binding and spread in object literals?)

Screenshot 2022-12-03 at 9 48 36 AM

I believe this is from the use of optional catch binding Screenshot 2022-12-03 at 9 49 36 AM

which isn't available until iOS 11.3

Screenshot 2022-12-03 at 9 51 52 AM

It's not shown in the above screenshot, but in my own app I've seen this error

Unexpected token: '...'. Expected a property name.

I believe this is from using spread in object literals which also isn't supported until 11.3
Screenshot 2022-12-03 at 9 50 29 AM

Screenshot 2022-12-03 at 9 51 17 AM Screenshot 2022-12-03 at 9 53 45 AM

Suggested / requested changes

I'm not sure if Remix should change the source files to avoid using these patterns or do transforms to change the distributed code, but it should be possible to use Remix in iOS 11.0 without syntax errors.

Also, is there a way to add tests/checks for this to prevent regressions?

@machour
Copy link
Collaborator

machour commented Dec 3, 2022

Thank you for the detailed report. This is already tracked in #1901

@machour machour closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2022
@jfsiii
Copy link
Author

jfsiii commented Dec 3, 2022

@machour I've seen that ticket (I mentioned this there)

However, that ticket references iOS 12 and some newer features than this ticket. To achieve the documented browse support Remix needs to run in iOS 11.0.

This ticket mentions more syntax errors and the and the places in remix which cause them. Perhaps that ticket could be updated to include the information from here?

@machour
Copy link
Collaborator

machour commented Dec 3, 2022

@jfsiii we have your latest comment there + a reference to this issue, it should be ok.
Team is planning on adding support for browserlist, which should allow everyone to fine-tune compatibility 👌🏼

@MichaelDeBoey MichaelDeBoey added the duplicate This issue or pull request already exists label Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:unverified duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants