After vue@next3.2.x ,create by vite,The project con't read composition api
Version
3.2.20
Reproduction link
Steps to reproduce
create a project width vite and typescript, By the lastest version, import { InjectionKey, provide, inject } from 'vue', It's will report an error, TS2305: Module '"../../node_modules/vue/dist/vue"' has no exported member 'InjectionKey | provide | inject' tips: System: Mac OS
What is expected?
import { InjectionKey, provide, inject } from 'vue' can work in project
What is actually happening?
Module '"../../node_modules/vue/dist/vue"' has no exported member 'InjectionKey | provide | inject'
I can't reproduce this with a fresh Vite project, and you didn't provide an actual reproduction of the issue. Closing.
I can't reproduce this with a fresh Vite project, and you didn't provide an actual reproduction of the issue. Closing.
I'm sorry, you can fresh in https://codesandbox.io/s/typescript-vue3-error-dihwv, and my local project screenshots
@LinusBorg
InjectionKey
is not exported. see docs https://v3.vuejs.org/api/composition-api.html#provide-inject and sfc
Yes it is.
https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/apiInject.ts#L6
But import { InjectionKey } from 'vue'
this line will show an error.
Isn't this a bug?
The node version I use v12.18.1 & v14.15.2, I thought isn't a reson for node service. I find the node_modules @runtime-core, the following screenshots