Wired type errors when using TypeScript + <slot> + SSR
See original GitHub issueVersions:
@inertiajs/inertia
version: 0.11.0@inertiajs/inertia-vue3
version: 0.6.0
Describe the problem:
Wired type errors when using TypeScript + <slot> + SSR.
Steps to reproduce:
I forked pingcrm
and made a single commit to reproduce the problem.
- The only change component is
resources/js/Shared/Layout.vue
.
git clone https://github.com/xieyuheng/pingcrm
cd pingcrm; yarn; yarn ssr:build
Please see this commit for changed files: https://github.com/xieyuheng/pingcrm/commit/fecd31f551ee528a7ce905905de3e2728ff19119
Errors
✖ Mix
Compiled with some errors in 4.72s
ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts
28:4-11
[tsl] ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts(28,5)
TS2322: Type 'Function' is not assignable to type 'SSRSlot'.
Type 'Function' provides no match for the signature '(props: Props, push: PushFn, parentComponent: ComponentInternalInstance | null, scopeId: string | null): void'.
ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts
28:23-24
[tsl] ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts(28,24)
TS7006: Parameter '_' implicitly has an 'any' type.
ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts
28:26-31
[tsl] ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts(28,27)
TS7006: Parameter '_push' implicitly has an 'any' type.
ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts
28:33-40
[tsl] ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts(28,34)
TS7006: Parameter '_parent' implicitly has an 'any' type.
ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts
28:42-50
[tsl] ERROR in /home/xyh/backup/pingcrm/resources/js/Shared/Layout.vue.ts(28,43)
TS7006: Parameter '_scopeId' implicitly has an 'any' type.
...
webpack compiled with 51 errors
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
v-slot with { } accept slot data has type any error in typescript ...
Yes, we can't infer type from slot. If you want this, please open a issue, but maybe have related issue. It definitely enhances...
Read more >vue.js - Vue3 + Vite + Typescript: Scoped slots type error
Have you tried adding type information? <DataWrapper v-slot="{ values }: ... If you are using eslint you can also surround the DataWrapper with...
Read more >List and List Items | Quasar Framework
The QList and QItem are a group of components which can work together to present multiple line items vertically as a single continuous...
Read more >A curated list of awesome things related to Vue.js
Starter application ready for production with TypeScript, vuex, ... Also works with SSR (e.g. VuePress, Nuxt) and includes TypeScript types.
Read more >Sharing State - Astro Documentation
When building an Astro website with islands architecture / partial hydration, you may have run into this problem: I want to share state...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @xieyuheng
Can set ts-loader options
transpileOnly: true
to skip type check for inertia SSR:webpack.ssr.mix.js
see: https://github.com/TypeStrong/ts-loader#transpileonly
Hi @henryavila
Sorry for late reply.
I use ts in my app, just not in vue files.
For examples:
Here is my
tsconfig.json
:Here is my
webpack.mix.js
:Here is my
webpack.ssr.mix.js
: