<script setup> Error: ‘defineProps‘ is not defined [How to Solve]

Solution 1: in eslintrc. JS env add configuration

  env: {
    'vue/setup-compiler-macros': true // New
  }

An error may be reported when the development service is restarted after configuration:

Environment key “vue/setup-compiler-macros” is unknown

Recompile again and the error disappears.

Solution 2: add global configuration in eslintrc.js

  globals: {
    defineProps: "readonly",
    defineEmits: "readonly"
  }

Read More: