Skip to content

Commit

Permalink
Fix broken experience for older Safari and Edge (#219)
Browse files Browse the repository at this point in the history
## 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)
  • Loading branch information
sawyerh authored Oct 3, 2023
1 parent c8735fb commit d616ce2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ const nextConfig = {
// https://nextjs.org/docs/app/api-reference/next-config-js/output
output: "standalone",
sassOptions: appSassOptions,
// Continue to support older browsers (ES5)
transpilePackages: [
// Continue to support older browsers (ES5)
// https://github.com/i18next/i18next/issues/1948
"i18next",
"react-i18next",
// https://github.com/trussworks/react-uswds/issues/2605
"@trussworks/react-uswds",
],
};

Expand Down

0 comments on commit d616ce2

Please sign in to comment.