vue-native-websocket-vue3 icon indicating copy to clipboard operation
vue-native-websocket-vue3 copied to clipboard

Can not to import

Open hamedg68 opened this issue 2 years ago • 5 comments

I am using vite and in main.ts file I have this error

Could not find a declaration file for module 'vue-native-websocket-vue3'. '..../node_modules/vue-native-websocket-vue3/dist/vueNativeWebsocket.common.js' implicitly has an 'any' type. Try npm i --save-dev @types/vue-native-websocket-vue3 if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-native-websocket-vue3

According to error message I try to install @types/vue-native-websocket-vue3 but I have the following error

error An unexpected error occurred: "https://registry.yarnpkg.com/@types%2fvue-native-websocket-vue3: Not found".

hamedg68 avatar Apr 27 '23 09:04 hamedg68

I have a project that is also built based on vite+vue3+ts, and it can run normally. You can refer to the writing method of my project to troubleshoot the problem.

chat-system

likaia avatar Apr 27 '23 09:04 likaia

Ok! I have cloned the chat-system however the project runs but in main.ts I have the same typescript error

hamedg68 avatar Apr 27 '23 10:04 hamedg68

Ok! I have cloned the chat-system however the project runs but in main.ts I have the same typescript error

This is impossible, what editor are you using?

likaia avatar Apr 27 '23 12:04 likaia

I am using vs-code editor

hamedg68 avatar Apr 29 '23 11:04 hamedg68

I tried vscode, it is normal and no error is reported.

image

The project can also start normally.

image

likaia avatar May 02 '23 00:05 likaia

Hi @likaia,

The error is caused by inconsistent capitalization of the first letter of the type file name. In Linux, file names are strictly case-sensitive, so the error will not appear in Windows.

image image

xiaoji106 avatar Oct 23 '24 08:10 xiaoji106

Hi @likaia,

The error is caused by inconsistent capitalization of the first letter of the type file name. In Linux, file names are strictly case-sensitive, so the error will not appear in Windows.

image image

Got it. I'll change it.

likaia avatar Oct 23 '24 08:10 likaia

Hi @likaia, The error is caused by inconsistent capitalization of the first letter of the type file name. In Linux, file names are strictly case-sensitive, so the error will not appear in Windows. image image

Got it. I'll change it.

Fixed, just update the version to 3.1.8

likaia avatar Oct 23 '24 08:10 likaia