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

[fix] Safari versions below 14 are broken by this package #2605

Open
sawyerh opened this issue Sep 29, 2023 · 0 comments
Open

[fix] Safari versions below 14 are broken by this package #2605

sawyerh opened this issue Sep 29, 2023 · 0 comments
Labels
type: bug Something isn't working like it's supposed to

Comments

@sawyerh
Copy link
Contributor

sawyerh commented Sep 29, 2023

ReactUSWDS Version & USWDS Version:

"@trussworks/react-uswds": "^5.0.0",
"@uswds/uswds": "3.1.0",

Describe the bug

Not sure if this is a bug or a feature. Currently usage of this package will break the experience for users of Safari versions below 14, with the following JS exception:

Unexpected token '='. Expected an opening '(' before a method's parameter list.

A related Stackoverflow on this error is here.

To Reproduce

Open any project using the package, including the React USWDS Storybook, in Safari 13. Observe the error in the console (and a blank page).

Expected behavior

I'm not sure if this is expected or not. The browserslist is likely where this is surfacing from.

Screenshots

I was able to reproduce and then resolve this issue in a Next.js project by configuring Next.js to transpile the "@trussworks/react-uswds" package.

Before the transpiling:

CleanShot 2023-09-29 at 12 49 11@2x

After:

CleanShot 2023-09-29 at 12 47 49@2x
@sawyerh sawyerh added the type: bug Something isn't working like it's supposed to label Sep 29, 2023
@sawyerh sawyerh changed the title [fix] [fix] Safari versions below 14 are broken by this package Sep 29, 2023
sawyerh added a commit to navapbc/template-application-nextjs that referenced this issue Oct 3, 2023
## Changes

- Configures Next.js to transpile the React USWDS and React I18next
packages to address an issue where its syntax was breaking the
experience for Safari versions prior to 14, and Edge versions prior to
79.

## Context for reviewers

I've filed a ticket on the React USWDS repo about one of the issues
here: trussworks/react-uswds#2605

The two JS exceptions we were seeing are:

1. [`Unexpected token
'='`](https://stackoverflow.com/questions/60026651/safari-unexpected-token-expected-an-opening-before-a-methods-paramet)
2. [`Expected identifier, string or
number`](https://confluence.atlassian.com/insightapps/known-issue-with-older-versions-of-microsoft-edge-1085191263.html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working like it's supposed to
Projects
None yet
Development

No branches or pull requests

1 participant