owncloud / owncloud/web-extensions
[bug] Property '$gettext' does not exist on type 'CreateComponentPublicInstance
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 16
- Forks
- 11
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 23
Description
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.:
https://github.com/vuejs/language-tools/issues/3372
https://github.com/jshmrtn/vue3-gettext/issues/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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the packages/web-app-draw-io typecheck with vue-tsc --noEmit and inspect the $gettext use in src/App.vue. Compare the declaration in packages/web-app-draw-io/node_modules/vue3-gettext/dist/types/index.d.ts with the linked Vue language-tools and vue3-gettext reports. Done means the type augmentation works without the local workaround and the typecheck passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100