You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes the JavaScript heap out-of-memory error on the dev server introduced by #2874 when compiling /. The OOM was caused by intl-pluralrules and intl-displaynames loading large locale data files on every request via polyfillIntl() in _app.tsx, exhausting heap memory during development.
Both polyfills were unnecessary to begin with. intl-pluralrules was removed because all browsers we support have natively supported Intl.PluralRules since a long time ago.
intl-displaynames because the only known browser issue affects { format: 'script' } (formatjs/formatjs#5889), which we don't use. polyfillIntl now only polyfills Intl.Locale which has a legitimate compatibility reason to exist.
Also fixes the nodemon dev script which had -e specified twice with conflicting values and used the legacy -x flag instead of --exec. Finally adds transpilePackages: ['country-flag-icons'] to suppress a webpack cache warning on every build caused by the package using CommonJS as its main entry point, which confused webpack's JSON module resolution.
How Has This Been Tested?
Ran pnpm dev
Visited / and waited for it to compile and load successfully without javscript heap memory OOMing.
Without this fix, javascript heap memory OOM'd consistently.
Screenshots / Logs (if applicable)
Checklist:
I have read and followed the contribution guidelines.
The pull request simplifies internationalization (i18n) configuration by removing polyfills for plural rules and display names from the runtime, removing their npm dependencies, and updating the development script. Additionally, the Next.js configuration adds transparent transpilation support for the country-flag-icons package.
Changes
Cohort / File(s)
Summary
Build Configuration next.config.js
Added transpilePackages: ['country-flag-icons'] to enable Next.js transpilation of the country-flag-icons package.
Dependencies & Scripts package.json
Removed @formatjs/intl-displaynames and @formatjs/intl-pluralrules runtime dependencies; updated dev script to use nodemon --exec syntax watching ts,json,yml file types.
Simplified polyfill strategy: polyfillIntl() now takes no arguments and runs only the intl-locale polyfill, removing conditional logic for plural rules and display names locale data.
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
🐰 Hopping through configs with glee, Flags now transpile seamlessly! Stripped the fat, kept locale pure, Scripts refresh, the builds endure. ✨
The title 'chore: cleanup intl polyfills and dev config' accurately describes the main changes: removing unnecessary intl polyfills and fixing the dev server configuration.
Linked Issues check
✅ Passed
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
✅ Passed
Check skipped because no linked issues were found for this pull request.
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the JavaScript heap out-of-memory error on the dev server introduced by #2874 when compiling
/. The OOM was caused byintl-pluralrulesandintl-displaynamesloading large locale data files on every request viapolyfillIntl()in_app.tsx, exhausting heap memory during development.Both polyfills were unnecessary to begin with.

intl-pluralruleswas removed because all browsers we support have natively supported Intl.PluralRules since a long time ago.intl-displaynamesbecause the only known browser issue affects{ format: 'script' }(formatjs/formatjs#5889), which we don't use.polyfillIntlnow only polyfillsIntl.Localewhich has a legitimate compatibility reason to exist.Also fixes the nodemon
devscript which had-especified twice with conflicting values and used the legacy-xflag instead of--exec. Finally addstranspilePackages: ['country-flag-icons']to suppress a webpack cache warning on every build caused by the package using CommonJS as its main entry point, which confused webpack's JSON module resolution.How Has This Been Tested?
pnpm dev/and waited for it to compile and load successfully without javscript heap memory OOMing.Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit
Release Notes
Chores