Skip to content

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

Description

@dschmidt

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions