quasar icon indicating copy to clipboard operation
quasar copied to clipboard

Workaround for `useI18n` is generating warnings in a loop

Open Evertvdw opened this issue 3 years ago • 4 comments

The workaround for using i18n with composition api currently described here: https://quasar.dev/start/upgrade-guide#vue-i18n-v9 causes some problems for me.

When used it generated the following warning message:

[intlify] Not supported 'formatter'.
[intlify] Not supported 'preserveDirectiveContent'.

And on HMR it then ends up in a loop where there is a constant stream of warnings clogging the console. Using the useI18n method exported by vue-i18n does not have this issue, so I resolved to using that. Is there anyone else having this same issue?

I am using unplugin-auto-import together with script setup, it might also have something to do with that if nobody else has this same problem.

Evertvdw avatar Nov 26 '21 15:11 Evertvdw

I have the same problem with all the errors you mention, but they don't end in an infinite loop. There are just lots of them. It seems that they are generated only when Vue Dev Tools is activated. Try in an incognito window without opening Vue Dev Tools and see if you have the same problem. I also use the built-in useI18n, as the proposed example doesn't have the options param.

ovidiuc avatar Nov 29 '21 11:11 ovidiuc

Is there a way to solve it?

Nicolana avatar Apr 07 '22 15:04 Nicolana

createI18n, options, legacy: false

95sunny avatar May 23 '22 07:05 95sunny

To elaborate on what @95sunny said: If you are using the composition API with vue-i18n, you need to add legacy: false to the options passed to createI18n.

https://vue-i18n.intlify.dev/guide/advanced/composition.html#basic-usage

axle07 avatar Aug 08 '22 18:08 axle07

I'm getting hundreds of thousands of these warnings and it's crashing my tab in storybook just by having a custom warnHandler defined in my app. I'm not using the composition API

thedamon avatar Sep 29 '22 14:09 thedamon

To elaborate on what @95sunny said: If you are using the composition API with vue-i18n, you need to add legacy: false to the options passed to createI18n.

https://vue-i18n.intlify.dev/guide/advanced/composition.html#basic-usage

this save my day! thank you!

heinkel avatar Jul 28 '23 07:07 heinkel