fix: add React module chunking for Vite to resolve runtime errors #760, #761#762
Conversation
✅ Deploy Preview for tanstack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
📝 WalkthroughWalkthroughAdded a new manualChunks rule in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
vite.config.ts (1)
78-84: Quote style inconsistency and pattern precision.Two minor observations:
Quote style: The new code uses double quotes while the rest of the file consistently uses single quotes. Consider aligning with the existing convention.
Pattern consistency:
node_modules/react-domlacks a trailing slash, unlikenode_modules/react/. While unlikely to cause issues in practice, adding the slash prevents false matches on hypotheticalreact-dom-*packages and aligns both patterns.🔧 Suggested diff
if ( - id.includes("node_modules/react-dom") || - id.includes("node_modules/react/") + id.includes('node_modules/react-dom/') || + id.includes('node_modules/react/') ) { - return "react"; + return 'react' }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@vite.config.ts` around lines 78 - 84, Update the string literals and patterns in the ID check inside the vite config so they match the project's single-quote style and use consistent trailing slashes: change the double-quoted "node_modules/react-dom" to a single-quoted 'node_modules/react-dom/' and change "node_modules/react/" to 'node_modules/react/' in the conditional that returns "react" (the block referencing id.includes(...) that returns "react") so both patterns are precise and quote style is consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@vite.config.ts`:
- Around line 78-84: Update the string literals and patterns in the ID check
inside the vite config so they match the project's single-quote style and use
consistent trailing slashes: change the double-quoted "node_modules/react-dom"
to a single-quoted 'node_modules/react-dom/' and change "node_modules/react/" to
'node_modules/react/' in the conditional that returns "react" (the block
referencing id.includes(...) that returns "react") so both patterns are precise
and quote style is consistent.
chore: format and narrow down deps (react-dom/) chore: make sure scheduler comes with react too
74df56f to
7251893
Compare
|
Thank you for this fix! |

Seems like there is a regression after this commit.
Related: #760, #761
This should solve errors like these.
Should we also disable
onlyExplicitManualChunks?Summary by CodeRabbit