Despite trying numerous methods, I consistently encounter build or runtime errors. To my surprise, I have not come across a functional example or post related to this inquiry after extensive research. I initiated a new project with Typescript using the Vue UI and created the subsequent component:
<template>
<div class="navigation">
BACK | NEXT buttons go here
</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
@Component
export default class BackNext extends Vue {
}
</script>
Subsequently, when attempting to utilize this component in a .vue view file, this is the closest approximation achieved:
<template>
<div class="question">
<h1>Personal</h1>
<back-next />
</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import BackNext from "../../components/BackNext.vue";
@Component
export default class Personal extends Vue {
components = {
'back-next': BackNext
}
}
</script>
However, this process fails with multiple build errors:
ERROR Failed to compile with 11 errors4:22:27 PM
These dependencies were not found:
* core-js/modules/es.object.get-prototype-of in ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
* core-js/modules/es.object.to-string in ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js, ./node_modules/@babel/runtime/helpers/esm/typeof.js
* core-js/modules/es.reflect.construct in ./node_modules/@babel/runtime/helpers/esm/createSuper.js, ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
* core-js/modules/es.regexp.to-string in ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
* core-js/modules/es.string.iterator in ./node_modules/@babel/runtime/helpers/esm/typeof.js
* core-js/modules/es.symbol in ./node_modules/@babel/runtime/helpers/esm/typeof.js
* core-js/modules/es.symbol.description in ./node_modules/@babel/runtime/helpers/esm/typeof.js
* core-js/modules/es.symbol.iterator in ./node_modules/@babel/runtime/helpers/esm/typeof.js
* core-js/modules/web.dom-collections.iterator in ./node_modules/@babel/runtime/helpers/esm/typeof.js
To install them, you can run: npm install --save core-js/modules/es.object.get-prototype-of core-js/modules/es.object.to-string core-js/modules/es.reflect.construct core-js/modules/es.regexp.to-string core-js/modules/es.string.iterator core-js/modules/es.symbol core-js/modules/es.symbol.description core-js/modules/es.symbol.iterator core-js/modules/web.dom-collections.iterator
The necessity to install various dependencies for standard functionality in a new project with Typescript support seems counterintuitive. I am hesitant to clutter my project with unnecessary installations that may lead to further complications.
npm version 6.13.4
node version 12.16.1
yarn version 1.22.4
vue version @vue/clu 4.5.3