Skip to content

Commit 3f55ab2

Browse files
authoredMar 21, 2025··
fix: warning to recommend disabling bundle.optimizeTranslationDirective (#3436)
1 parent f5a47da commit 3f55ab2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/prepare/options.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ export function prepareOptions({ debug, logger, options }: I18nNuxtContext, nuxt
1414
if (options.bundle.compositionOnly && options.types === 'legacy') {
1515
throw new Error(
1616
formatMessage(
17-
'`bundle.compositionOnly` option and `types` option is conflicting: ' +
17+
'`bundle.compositionOnly` option and `types` option are conflicting: ' +
1818
`bundle.compositionOnly: ${options.bundle.compositionOnly}, types: ${JSON.stringify(options.types)}`
1919
)
2020
)
2121
}
2222

23+
if (!nuxt.options?._prepare && nuxt.options.i18n?.bundle?.optimizeTranslationDirective == null) {
24+
logger.warn(
25+
'`bundle.optimizeTranslationDirective` is enabled by default, we recommend disabling this feature as it causes issues and will be deprecated in v10.\nExplicitly setting this option to `true` or `false` disables this warning, for more details see: https://github.com/nuxt-modules/i18n/issues/3238#issuecomment-2672492536'
26+
)
27+
}
28+
2329
if (options.experimental.autoImportTranslationFunctions && nuxt.options.imports.autoImport === false) {
2430
logger.warn(
2531
'Disabling `autoImports` in Nuxt is not compatible with `experimental.autoImportTranslationFunctions`, either enable `autoImports` or disable `experimental.autoImportTranslationFunctions`.'

0 commit comments

Comments
 (0)
Please sign in to comment.