diff --git a/.changeset/fluffy-mangos-begin.md b/.changeset/fluffy-mangos-begin.md new file mode 100644 index 0000000000..9bfe34f115 --- /dev/null +++ b/.changeset/fluffy-mangos-begin.md @@ -0,0 +1,5 @@ +--- +"blitz": patch +--- + +Prevent `Minified react error #419` in production diff --git a/packages/blitz/src/cli/utils/codegen-tasks.ts b/packages/blitz/src/cli/utils/codegen-tasks.ts index 9305bb246a..1e69d9ae7a 100644 --- a/packages/blitz/src/cli/utils/codegen-tasks.ts +++ b/packages/blitz/src/cli/utils/codegen-tasks.ts @@ -19,7 +19,7 @@ export const codegenTasks = async () => { .toString() .replace( /ReactDOM\.hydrateRoot\(.*?\);/, - `ReactDOM.hydrateRoot(domEl, reactEl, {onRecoverableError: (err) => err.toString().includes("could not finish this Suspense boundary") ? null : console.error(err)});`, + `ReactDOM.hydrateRoot(domEl, reactEl, {onRecoverableError: (err) => (err.toString().includes("could not finish this Suspense boundary") || err.toString().includes("Minified React error #419")) ? null : console.error(err)});`, ) await fs.writeFile(nextClientIndex, updatedFile) log.success("Next.js was successfully patched with a React Suspense fix") diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d4a4c7356d..378181de2b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3109,7 +3109,6 @@ packages: semver: 5.7.1 transitivePeerDependencies: - supports-color - dev: false /@babel/preset-flow/7.17.12_@babel+core@7.18.2: resolution: @@ -5540,7 +5539,6 @@ packages: typescript: 4.6.3 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/experimental-utils/5.28.0_hrkuebk64jiu2ut2d2sm4oylnu: resolution: @@ -9367,7 +9365,6 @@ packages: transitivePeerDependencies: - eslint-import-resolver-webpack - supports-color - dev: false /eslint-config-next/12.2.5_hrkuebk64jiu2ut2d2sm4oylnu: resolution: @@ -9405,7 +9402,6 @@ packages: hasBin: true peerDependencies: eslint: ">=7.0.0" - dev: false /eslint-config-prettier/8.5.0_eslint@7.32.0: resolution: