I'm trying to migrate my Nuxt app to Typescript.
Here is an example:
<!-- pages/index.vue -->
<template>
<div>...</div>
</template>
<script lang="ts">
import { Component, Vue } from "nuxt-property-decorator";
@Component
export default class Index extends Vue {}
</script>
I get the following error:
ERROR in ./pages/index.vue?vue&type=script&lang=ts& friendly-errors 14:20:39
Module parse failed: Unexpected character '@' (176:0) friendly-errors 14:20:39
File was processed with these loaders:
* ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { Component, Vue } from "nuxt-property-decorator";
|
> @Component
| export default class Index extends Vue {}
|
friendly-errors 14:20:39
@ ./pages/index.vue?vue&type=script&lang=ts& 1:0-117 1:133-136 1:138-252 1:138-252
@ ./pages/index.vue
@ ./.nuxt/router.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
I'm trying to migrate my Nuxt app to Typescript. Here is an example:
I get the following error:
Is it a configuration issue ?