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(intl-messageformat): throw when a value is undefined or null #3256

merged 2 commits into from
Nov 9, 2021


Copy link

@amannn amannn commented Nov 4, 2021

Fixes #3249

Currently the behaviour is the same for all kinds of arguments. I stumbled upon this with a date argument where I was a bit surprised that the default of the current date is used. I guess it's open to debate if this behaviour should be consistent across all value types, or if it would make sense to only use it for use cases like dates.

@longlho longlho merged commit b3ac86d into formatjs:main Nov 9, 2021
Copy link

longlho commented Nov 9, 2021

Thanks a lot for your contributions!

Copy link

This is a breaking change for us. Sometimes we were passing undefined before a value was fully materialized from some async work. For something like:
"owned by {owner}" it would initially evaluate to "owned by " and then immediately update to "owned by John" now an exception is thrown and nothing renders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Stricter check for missing dates in IntlMessageFormat
3 participants