Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in DateRangePicker when using SSR optimized localized strings #6286

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

devongovett
Copy link
Member

In our Next.js example app, when selecting a range in a DateRangePicker with reversed order, the page would crash with an error about a missing localized string. In that setup, the optimize-locales-plugin is used to remove all localized strings from the JS bundle, and they are injected into the page during SSR. However, this particular code used the dictionary imported from the JS bundle, and did not load the global dictionary from the window like other parts of the code.

@rspbot
Copy link

rspbot commented Apr 29, 2024

@rspbot
Copy link

rspbot commented Apr 29, 2024

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran locally and I'm getting this:

Unhandled Runtime Error
Error: Could not find intl message rangeReversed in en-US locale

Call Stack
$5b160d28a433310d$export$c17fa47878dc55b6.getStringForLocale

@devongovett
Copy link
Member Author

How did you run? I guess you have to either run verdaccio or do a build and then yarn link the packages into the example app

@reidbarber
Copy link
Member

Ahh yeah, I forgot the local wasn't already linked.

@devongovett devongovett merged commit 06a2817 into main Apr 30, 2024
25 checks passed
@devongovett devongovett deleted the fix-datepicker-string branch April 30, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants