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

Warning about non-compiled messages is emitted when there are no messages defined #2610

Closed
GertSallaerts opened this issue Feb 15, 2021 · 0 comments
Labels

Comments

@GertSallaerts
Copy link

The warning from the code below is shown when the configured messages object is empty, I'd have expected it would only trigger when there are actually some messages to test. In our case this happens when the messages are still being loaded.

function verifyConfigMessages<T = string>(config: OptionalIntlConfig<T>) {
if (
config.defaultRichTextElements &&
!messagesContainAst(config.messages || {})
) {
console.warn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
For more details see https://formatjs.io/docs/getting-started/message-distribution`);
}
}

@longlho longlho added the bug label Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants