error PropType not found in 'vue' in open source project

3.5k Views Asked by At

i am trying to work on an opensource software for NLP named doccano,i tried running only the frontend part where i ran the command npm install to get all needed dependencies then when i run npm run dev it starts compiling and then fails with this error

    /home/nissow/Documents/doccano/doccano/frontend/components/project/FormDelete.vue
  33:14  error  PropType not found in 'vue'  import/named

and when i checked the FormDelete.vue i did not notice any errors and no errors were detected on vscode either

<script lang="ts">
import Vue,{ PropType } from 'vue'
import BaseCard from '@/components/utils/BaseCard.vue'
import { ProjectDTO } from '~/services/application/project/projectData'

export default Vue.extend({
components: {
BaseCard
},

props: {
 selected: {
  type: Array as PropType<ProjectDTO[]>,
  default: () => []
 }
},

computed: {
  nonDeletableProjects(): ProjectDTO[] {
  return this.selected.filter(item => !item.current_users_role.is_project_admin)
},
hasNonDeletableProjects(): boolean {
  return this.nonDeletableProjects.length > 0
 }
}
})
</script>

here's package.json content :

enter image description here

and here's the second part

enter image description here

3

There are 3 best solutions below

1
On

It was also a problem elsewhere. Sounds like a known bug in eslint and typescript. It doesn't seem to cause an error depending on the version.

https://github.com/nuxt-community/composition-api/issues/189

0
On

i just made it work, by installing yarn and then running, yarn dev as it was suggested in the README.MD the first time i was doing it with npm run dev.

0
On
import type { PropType } from 'vue' 

see detail https://github.com/nuxt-community/composition-api/issues/189