Skip to content

Commit

Permalink
Prevent Minified react error #419 in production (#3755)
Browse files Browse the repository at this point in the history
* add check for Minified React error #419 during codegen nextjs patch
  • Loading branch information
Dillon Raphael authored Aug 22, 2022
1 parent 3d950f7 commit 638f231
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-mangos-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"blitz": patch
---

Prevent `Minified react error #419` in production
2 changes: 1 addition & 1 deletion packages/blitz/src/cli/utils/codegen-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 0 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 638f231

Please sign in to comment.