fix: use temporal-polyfill via npm overrides to resolve JSBI issues#442
Merged
jens-maus merged 1 commit intojens-maus:masterfrom Feb 3, 2026
Merged
Conversation
Fixes jens-maus#441 Resolves BigInt/JSBI compatibility issues with bundlers like Next.js Turbopack and Webpack by using npm overrides to replace @js-temporal/polyfill with temporal-polyfill (FullCalendar). Note: While npm overrides is not the ideal solution, this approach is acceptable as a temporary measure because: - rrule-temporal maintainer declined switching to temporal-polyfill (see ggaabe/rrule-temporal#94) - The polyfill will be removed entirely once Node.js ships native Temporal support (planned for future Node.js versions) - This provides immediate relief for users hitting the JSBI bundler bug Changes: - Add npm overrides to redirect @js-temporal/polyfill → temporal-polyfill - Add tests to ensure temporal-polyfill is used and JSBI is not installed Benefits: - Eliminates JSBI dependency completely -> smaller bundle size - Better compatibility with Next.js, Turbopack, and Webpack - Uses native BigInt instead of polyfill (Node 18+ has native support) The npm overrides feature ensures that rrule-temporal's transitive dependency on @js-temporal/polyfill is replaced with temporal-polyfill, avoiding the 'e.BigInt is not a function' error that occurs when JSBI fails to load correctly in certain build environments. See also: - js-temporal/temporal-polyfill#231 - ggaabe/rrule-temporal#94 - https://github.com/fullcalendar/temporal-polyfill
📝 WalkthroughWalkthroughThis pull request switches the temporal polyfill from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #441
Problem
Users cannot upgrade from v0.22.1 to v0.23+ when using Next.js with Turbopack due to bundler errors:
The issue occurs because
rrule-temporaldepends on@js-temporal/polyfill, which uses the JSBI library to polyfill BigInt. Modern bundlers like Turbopack and Webpack fail to properly tree-shake or optimize JSBI's emulation code.Solution
This PR uses npm overrides to replace
@js-temporal/polyfillwithtemporal-polyfill, which uses native BigInt instead of JSBI. Both polyfills implement the same Temporal API and are compatible via duck-typing.Changes:
@js-temporal/polyfilltotemporal-polyfill@^0.3.0Why npm overrides?
This isn't the ideal solution, but it seems the most pragmatic approach because:
rrule-temporalmaintainer does not intend to switch totemporal-polyfill(see rrule-temporal/issue #94).Impact
Summary by CodeRabbit
Chores
Tests