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

beta.11 regression: I18N interface no longer has an installfunction #225

Closed
cexbrayat opened this issue Dec 11, 2020 · 8 comments
Closed

Comments

@cexbrayat
Copy link

vue & vue-i18n version

ex:

  • vue: 3.0.4
  • vue-i18n: 9.0.0-beta.11

Reproduction Link

cexbrayat/vue-cli-playground#2

Steps to reproduce

yarn and yarn serve throws:

TS2345: Argument of type 'I18n<{ en: { hello: string; }; }, unknown, unknown, true>' is not assignable to parameter of type 'Plugin_2'.
  Property 'install' is missing in type 'I18n<{ en: { hello: string; }; }, unknown, unknown, true>' but required in type '{ install: PluginInstallFunction; }'.
    4 |
    5 | createApp(App)
  > 6 |   .use(i18n)
      |        ^^^^
    7 |   .mount('#app')

Unit tests also fail.

It appears that the I18n interface used to have an install property, but no longer has one in beta.11.

What is Expected?

We should be able to use the i18n plugin with TS

What is actually happening?

We can't use the plugin as it does not compile with beta.11

@Alymbek
Copy link

Alymbek commented Dec 12, 2020

I just updateed to beta-11 and getting below error message:

Module build failed (from ./node_modules/@intlify/vue-i18n-loader/lib/index.js):
TypeError: vue_i18n_1.baseCompile is not a function

@npm-ued
Copy link

npm-ued commented Dec 12, 2020

@cexbrayat me too

@npm-ued
Copy link

npm-ued commented Dec 12, 2020

vue-i18n 9.0.0-beta.11
vue 3.03

@kazupon
Copy link
Member

kazupon commented Dec 12, 2020

I just updateed to beta-11 and getting below error message:

Module build failed (from ./node_modules/@intlify/vue-i18n-loader/lib/index.js):
TypeError: vue_i18n_1.baseCompile is not a function

As mention at #222, In beta.11, I released the re-packed modules with monorepo to solve the CSP problem.

I'm working on bundle loader /plugins.

@hezechang
Copy link

me too

Argument of type 'I18n<{}, {}, {}, true>' is not assignable to parameter of type 'Plugin_2'.
Property 'install' is missing in type 'I18n<{}, {}, {}, true>' but required in type '{ install: PluginInstallFunction; }'

@kayahasa
Copy link

me too
src/main.ts:50:9
TS2345: Argument of type 'I18n<{ en: { darkmode: string; }; ja: { darkmode: string; }; }, unknown, unknown, true>' is not assignable to parameter of type 'Plugin_2'.
Property 'install' is missing in type 'I18n<{ en: { darkmode: string; }; ja: { darkmode: string; }; }, unknown, unknown, true>' but required in type '{ install: PluginInstallFunction; }'.

@kazupon
Copy link
Member

kazupon commented Dec 13, 2020

I've just released out 9.0.0-beta.12
fixed i18n interface install type missing.
please check it!

@kazupon kazupon closed this as completed Dec 13, 2020
@meddario
Copy link

Hi,
this seems still relevant with version 9.0.0-beta.16:

Argument of type '{ i18n: I18n<{ en: { message: { hello: string; }; }; it: { message: { hello: string; }; }; }, unknown, unknown, true>; }' is not assignable to parameter of type 'Plugin_2'.
  Property 'install' is missing in type '{ i18n: I18n<{ en: { message: { hello: string; }; }; it: { message: { hello: string; }; }; }, unknown, unknown, true>; }' but required in type '{ install: PluginInstallFunction; }'.ts(2345)
runtime-core.d.ts(889, 5): 'install' is declared here.

Is there any workaround?

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

No branches or pull requests

7 participants