From d616ce28f5b82c97221f9118526355c348e54724 Mon Sep 17 00:00:00 2001 From: Sawyer Hollenshead Date: Tue, 3 Oct 2023 11:06:08 -0700 Subject: [PATCH] Fix broken experience for older Safari and Edge (#219) ## 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: https://github.com/trussworks/react-uswds/issues/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) --- app/next.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/next.config.js b/app/next.config.js index da9c87dd..d1287386 100644 --- a/app/next.config.js +++ b/app/next.config.js @@ -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", ], };