quasar: For help! Custom quasar perfetch reports an error
Hi~ For help!
package.json
"@quasar/app": "^1.6.0",
"@quasar/extras": "^1.5.2",
"quasar": "^1.9.8"
"typescript": "^3.8.3"
quasar.conf.js
supportTS: true
preFetch: true
Previously there were no errors with the @quasar/typescript
plug-in
thx!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (11 by maintainers)
Commits related to this issue
- feat(typescript): enhance prefetch typings Closes #6576 — committed to IlCallo/quasar by IlCallo 4 years ago
Let’s keep this open until the related PR is merged 😃
Fix will be available with “quasar” v1.9.16.
I probably also changed something into
@quasar/app
🤔 Can you replicate locally the changes I did in the PR?Problem 2 That’s just standard TypeScript stuff: you cannot augment an already defined method with a conflicting interface. Anyway you pointed me out that the context has not been typed properly, I’ll fix that 😃
Problem 1 Because of how
Promise.all
is typed, it will always return a promise of an array, while we expect aPromise<void>
. There are multiple solutions:Promise<void>
like thisPromise<{}>
, which will accept pretty much everything (evenvoid[]
andunknown[]
)Source: https://stackoverflow.com/questions/43597503/type-void-array-not-assignable-to-type-void