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

[bug] Property '$gettext' does not exist on type 'CreateComponentPublicInstance #16

Open
dschmidt opened this issue Jul 24, 2024 · 0 comments

Comments

@dschmidt
Copy link
Member

I'm having an issue with vue3-gettext on my local machine, interestingly enough there is no issue in CI and on @JammingBen 's machine.

When I run the typecheck (or look at the draw-io App in vscode), the type augmentation for ComponentCustomProperties doesn't work. I see this error:

packages/web-app-draw-io check:types$ vue-tsc --noEmit
│ src/App.vue(6,13): error TS2339: Property '$gettext' does not exist on type 'CreateComponentPublicInstance<ResolveProps<{ resource: { type: PropType<Resource>; required: true; }; applicationConfig: { type: PropType<AppConfigObject>; required: true; default: () => AppConf…
└─ Failed in 1.8s at /home/domme/dev/sources/owncloud/web-extensions/packages/web-app-draw-io

I can workaround it by replacing
declare module "@vue/runtime-core" {
with
declare module "vue" {
in packages/web-app-draw-io/node_modules/vue3-gettext/dist/types/index.d.ts.

c.f.:
vuejs/language-tools#3372
jshmrtn/vue3-gettext#33

We could workaround that issue by moving the $gettext call to a computed prop (currently there's only one occurence) or by patching the vue3-gettext package, if that affects more people than me ... so if you run into this, please let me know

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

1 participant