Open jiangmaniu opened 2 years ago
Did you ever solve this? I am getting the same issue.
+1, another workaround is adding import { $ } from 'vue/macros'
everywhere you need it, that corrects the typing but kinda defeats the whole auto-import feature.
Describe the bug
After I download the template, I execute the
ni
command to install the relevant dependencies of the template After installation, add the following code to<script>
ofApp.vue
When using
$()
to convertRef
to reactive variables, the type of$()
is overwritten by the type ofjquery
incypress
I was looking at
tsconfig.ts
and found that the type ofcypress
package was excluded and only included intsconfig.ts
inside the/cypress
folder, but this doesn't seem to work, invue
vscode
in the file still recognizes the type ofcypress
package, I don't know what's going on here.I tried uninstalling the
cypress
package to test if the conflict was really caused by thecypress
package, which turned out to be correct.While the solution works, I need to use the
cypress
package in my project to test my project, so I can't live without it.I try to use
xxx as unknown as number
to assert the transformed variable before using it, it works, but if I need to assert every time I use it, it will increase the burden on my coding mind, I am eager Solve the conflict problem once and for all from a global perspective.What should I do please?
Reproduction
https://github.com/jiangmaniu/vitesse-type-conflict-repo
System Info
Used Package Manager
pnpm
Validations