From 7e13f8b8946baaab365096213684ee9cdda9e4b7 Mon Sep 17 00:00:00 2001 From: Courtney Myers Date: Fri, 6 Oct 2023 10:32:10 -0400 Subject: [PATCH] Add regenerator-runtime package to resolve issues with vite build --- app/client/package-lock.json | 23 +++++++++++------------ app/client/package.json | 1 + app/client/src/index.tsx | 9 +++++++++ app/client/vite.config.ts | 10 ---------- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/app/client/package-lock.json b/app/client/package-lock.json index 2ee82c9b..ff52c07d 100644 --- a/app/client/package-lock.json +++ b/app/client/package-lock.json @@ -25,6 +25,7 @@ "react-idle-timer": "5.7.2", "react-markdown": "8.0.7", "react-router-dom": "6.15.0", + "regenerator-runtime": "0.14.0", "remark-gfm": "3.0.1", "uswds": "2.14.0" }, @@ -78,11 +79,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/runtime/node_modules/regenerator-runtime": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" - }, "node_modules/@esbuild/android-arm": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", @@ -5398,6 +5394,11 @@ "@babel/runtime": "^7.9.2" } }, + "node_modules/regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "node_modules/regexp.prototype.flags": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz", @@ -6481,13 +6482,6 @@ "integrity": "sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==", "requires": { "regenerator-runtime": "^0.14.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" - } } }, "@esbuild/android-arm": { @@ -9971,6 +9965,11 @@ "@babel/runtime": "^7.9.2" } }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "regexp.prototype.flags": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz", diff --git a/app/client/package.json b/app/client/package.json index 2bbe9bb5..14b919aa 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -51,6 +51,7 @@ "react-idle-timer": "5.7.2", "react-markdown": "8.0.7", "react-router-dom": "6.15.0", + "regenerator-runtime": "0.14.0", "remark-gfm": "3.0.1", "uswds": "2.14.0" } diff --git a/app/client/src/index.tsx b/app/client/src/index.tsx index 119c2552..f6636159 100644 --- a/app/client/src/index.tsx +++ b/app/client/src/index.tsx @@ -1,5 +1,14 @@ import { StrictMode } from "react"; import { render } from "react-dom"; +/* + NOTE: regenerator-runtime is imported to avoid a bug with a GitHub Action + workflow including regenerator-runtime in the build as an external dependency. + For reference, the GitHub Action workflow's log message stated: + "regenerator-runtime/runtime.js" is imported by + "regenerator-runtime/runtime.js?commonjs-external", but could not be + resolved – treating it as an external dependency. +*/ +import "regenerator-runtime"; // --- import { ErrorBoundary } from "@/components/errorBoundary"; import { Providers } from "@/components/providers"; diff --git a/app/client/vite.config.ts b/app/client/vite.config.ts index 7079896e..690110a3 100644 --- a/app/client/vite.config.ts +++ b/app/client/vite.config.ts @@ -18,16 +18,6 @@ export default ({ mode }) => { outDir: "build", sourcemap: true, rollupOptions: { - /* - NOTE: The following is required to avoid a bug with a GitHub Action - workflow including `regenerator-runtime` in the build as an external - dependency. - - For reference, the GitHub Action workflow's log message stated: - "regenerator-runtime/runtime.js" is imported by "regenerator-runtime/runtime.js?commonjs-external", - but could not be resolved – treating it as an external dependency. - */ - external: ["regenerator-runtime"], output: { entryFileNames: "static/js/[name]-[hash].js", chunkFileNames: "static/js/[name]-[hash].js",