logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.73k stars 1.25k forks source link

No matching export in "node_modules/vue/dist/vue.runtime.esm-bundler.js" for import "toValue" #4486

Closed soknifedev closed 11 months ago

soknifedev commented 11 months ago

What happened?

I am not able to use vee-validate with vue 3 and vite, seems like a vue export used in vee-validate is missing.

Reproduction steps

  1. Use the following package.json
    {
    "name": "vuexy-starterkit-vue3",
    "version": "8.0.0",
    "private": true,
    "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview --port 5050",
    "lint": "eslint . -c .eslintrc.js --fix --ext .ts,.js,.vue,.tsx,.jsx",
    "build:icons": "node src/@iconify/build-icons.js",
    "postinstall": "npm run build:icons"
    },
    "dependencies": {
    "@casl/ability": "6.5.0",
    "@casl/vue": "2.2.1",
    "@floating-ui/dom": "1.2.7",
    "@tabler/icons": "2.17.0",
    "@vueuse/core": "10.1.0",
    "@vueuse/math": "10.1.0",
    "apexcharts-clevision": "3.28.5",
    "axios": "1.4.0",
    "axios-mock-adapter": "1.21.4",
    "chart.js": "4.3.0",
    "eslint-import-resolver-alias": "^1.1.2",
    "jwt-decode": "3.1.2",
    "pinia": "2.0.35",
    "prismjs": "1.29.0",
    "roboto-fontface": "0.10.0",
    "sass": "1.62.1",
    "unplugin-vue-define-options": "1.3.4",
    "vue": "3.2.47",
    "vue-chartjs": "5.2.0",
    "vue-flatpickr-component": "11.0.3",
    "vue-i18n": "9.2.2",
    "vue-prism-component": "2.0.0",
    "vue-router": "4.1.6",
    "vue3-apexcharts": "1.4.1",
    "vue3-perfect-scrollbar": "1.6.1",
    "vuetify": "3.2.1",
    "webfontloader": "1.6.28",
    "vee-validate": "^4.11.7",
    "vue-toastification": "^2.0.0-rc.5",
    "@vueuse/sound": "^2.0.1",
    "yup": "^1.0.2",
    "yup-locales": "^1.2.12"
    },
    "devDependencies": {
    "@antfu/eslint-config-vue": "0.38.5",
    "@fullcalendar/core": "6.1.6",
    "@fullcalendar/daygrid": "6.1.6",
    "@fullcalendar/interaction": "6.1.6",
    "@fullcalendar/list": "6.1.6",
    "@fullcalendar/timegrid": "6.1.6",
    "@fullcalendar/vue3": "6.1.6",
    "@iconify-json/fa": "1.1.4",
    "@iconify-json/tabler": "1.1.74",
    "@iconify/tools": "2.2.6",
    "@iconify/vue": "4.1.1",
    "@intlify/unplugin-vue-i18n": "0.10.0",
    "@vitejs/plugin-vue": "4.2.1",
    "@vitejs/plugin-vue-jsx": "3.0.1",
    "eslint": "8.39.0",
    "eslint-config-airbnb-base": "15.0.0",
    "eslint-plugin-import": "2.27.5",
    "eslint-plugin-promise": "6.1.1",
    "eslint-plugin-regex": "1.10.0",
    "eslint-plugin-sonarjs": "0.19.0",
    "eslint-plugin-unicorn": "46.0.0",
    "eslint-plugin-vue": "9.11.0",
    "postcss-html": "1.5.0",
    "stylelint": "14.15.0",
    "stylelint-config-idiomatic-order": "9.0.0",
    "stylelint-config-standard-scss": "6.1.0",
    "stylelint-use-logical-spec": "4.1.0",
    "unplugin-auto-import": "0.15.3",
    "unplugin-vue-components": "0.24.1",
    "vite": "4.3.3",
    "vite-plugin-pages": "0.29.0",
    "vite-plugin-vue-layouts": "0.8.0",
    "vite-plugin-vuetify": "1.0.2",
    "vue-shepherd": "3.0.0"
    },
    "packageManager": "yarn@1.22.18",
    "resolutions": {
    "postcss": "8"
    }
    }
  2. Create a simple vue app, import and use vee-validate
  3. run commands yarn to install deps and yarn dev to run the app.
  4. Error
    ...

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

Relevant log output

✘ [ERROR] No matching export in "node_modules/vue/dist/vue.runtime.esm-bundler.js" for import "toValue"

    node_modules/vee-validate/dist/vee-validate.esm.js:6:63:
      6 │ import { getCurrentInstance, inject, warn as warn$1, computed, toValue, ref, watch, nextTick, unref, isRef, reactive, onUnmounted, onMounted, provide, onBeforeUnmount, defineComponent, toRef, resolveDynamicComponent, h, readonly, watchEffect, shallowRef } from 'vue';

Demo link

cant reproduce in codesandbox

Code of Conduct

logaretm commented 11 months ago

Upgrade to Vue 3.3