under vuejs3 I install vee-validate with command
yarn add vee-validate@next
and on success I run server and got errors on
$ yarn run serve
yarn run v1.22.5
$ vue-cli-service serve
INFO Starting development server...
98% after emitting CopyPlugin
ERROR Failed to compile with 1 errors
2:07:01 PM
This dependency was not found:
* vee-validate/dist/rules in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/auth/Login.vue?vue&type=script&lang=js
To install it, you can run: npm install --save vee-validate/dist/rules
Error from chokidar (/mnt/_work_sdb8/wwwroot): Error: Circular symlink detected: "/mnt/_work_sdb8/wwwroot/wwwroot" points to "/mnt/_work_sdb8/wwwroot"
I pasted my code from vuejs 2 app as :
<script>
import { bus } from '../../../src/main'
import appMixin from '@/appMixin'
import { ValidationObserver, ValidationProvider, extend } from 'vee-validate'
import * as rules from 'vee-validate/dist/rules'
Object.keys(rules).forEach(rule => {
extend(rule, rules[rule])
})
export default {
name: 'loginPage',
mixins: [appMixin],
components: {
ValidationObserver,
ValidationProvider
},
But reading here https://github.com/logaretm/vee-validate I do not see if there is some syntax changes for vuejs 3 I have to apply ?
package.json:
{
"name": "yt3",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.20.0-0",
"core-js": "^3.6.5",
"mitt": "^2.1.0",
"moment-timezone": "^0.5.31",
"node-sass": "^4.12.0",
"sass-loader": "^10.0.4",
"vee-validate": "^4.0.0-beta.16",
"vue": "^3.0.0",
"vue-router": "^4.0.0-rc.1",
"vuex": "^4.0.0-rc.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^7.0.0-0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
}
}
}
MODIFIED BLOCK: I added line
"vee-validate": "^3.1.0"
in package.json file and running command
yarn
and
yarn run serve
I got error in browser's console:
vee-validate.esm.js?7bb1:867 Uncaught TypeError: vue__WEBPACK_IMPORTED_MODULE_0__.default is not a constructor
at eval (vee-validate.esm.js?7bb1:867)
at Module../node_modules/vee-validate/dist/vee-validate.esm.js (chunk-vendors.js:3389)
at __webpack_require__ (app.js:849)
at fn (app.js:151)
at eval (cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader-v16/dist/index.js?!./src/components/auth/Login.vue?vue&type=script&lang=js:10)
at Module../node_modules/cache-
looks like vee-validate 3 and vuejs 3 are not compatible?
Which validation tools for vuejs 3 would you advice?
Thanks!