After I updated my npm packages, errors started popping up in some of the imports from the 'vue' module:
TS2305: Module '"../../node_modules/vue/dist/vue"' has no exported member 'X'
The X instances affected include nextTick, onMounted, ref, watch, and more. When trying to serve the project, Vue throws a compilation error. Interestingly, WebStorm recognizes the exports, suggests them, and displays types, but the error persists. Notably, computed and defineComponent exports work without issues.
Here's what I've attempted so far:
- Reverting back to an older version of Vue - specifically "3.2.2" compared to the current "3.0.11". This temporarily resolves the type errors mentioned earlier, however, it causes the app to break completely with numerous 'TypeError: Object(...) is not a function' errors in the console and failure to render the app at all. Additionally, terminal warnings are introduced:
where X represents createElementBlock, createElementVNode, normalizeClass, and normalizeStyle."export 'X' (imported as '_X') was not found in 'vue'
- Rolling back other dependencies did not resolve the issue despite several attempts.
- Manually declaring the entire 'vue' module. While this method successfully removes the errors by declaring the 'vue' module exports in shims-vue.d.ts, it feels like a tedious workaround. Thus, I'm looking for a better solution if available.
List of all my dependencies:
"dependencies": {
"@capacitor/android": "3.0.0",
/* Rest of the dependency list remains unchanged */
},
"devDependencies": {
"@capacitor/cli": "3.0.0",
/* Rest of the devDependency list remains unchanged */
}