admin管理员组文章数量:1332649
I have a problem using a form validation named Vee Validate in Vue.js. I'm a beginner and not fully understand the import syntax. I install the vee-validate using npm i vee-validate --save
and it was placed in my node_modules. Now I import it in my main.js module and use the code given on the official page:
import { extend } from 'vee-validate';
import { required } from 'vee-validate/dist/rules';
extend('required', {
...required,
message: 'This field is required'
});
But when I open the index.html it gives an error:
Uncaught SyntaxError: The requested module '/@modules/vue.js' does not provide an export named 'default'
Here is the link to vee-validate package:
Thank you for helping me. Forgive me if my question is not clear.
I have a problem using a form validation named Vee Validate in Vue.js. I'm a beginner and not fully understand the import syntax. I install the vee-validate using npm i vee-validate --save
and it was placed in my node_modules. Now I import it in my main.js module and use the code given on the official page:
import { extend } from 'vee-validate';
import { required } from 'vee-validate/dist/rules';
extend('required', {
...required,
message: 'This field is required'
});
But when I open the index.html it gives an error:
Uncaught SyntaxError: The requested module '/@modules/vue.js' does not provide an export named 'default'
Here is the link to vee-validate package: https://www.npmjs./package/vee-validate?activeTab=readme
Thank you for helping me. Forgive me if my question is not clear.
Share Improve this question asked Jun 23, 2020 at 10:15 Russel SantosRussel Santos 271 gold badge1 silver badge10 bronze badges 3-
5
Are you using vue 3? I've had this error because somewhere in my (old vue 2) codebase there was something like this:
import Vue from 'vue';
– Philipp Mildenberger Commented Aug 19, 2020 at 9:34 - @PhilippMildenberger yes I already figure it out. That's exactly my problem. Thank you very much, sir! – Russel Santos Commented Aug 19, 2020 at 15:16
- 7 Care to share the solution? – yam Commented Dec 20, 2020 at 12:55
1 Answer
Reset to default 5I had the same problem when I made the migration to vuejs 3.
This: import Vue from 'vue';
has to be changed to:
import { createApp } from 'vue'
const app = createApp({})
Take a look to the guide: https://v3-migration.vuejs/breaking-changes/global-api.html#a-new-global-api-createapp
本文标签:
版权声明:本文标题:javascript - Uncaught SyntaxError: The requested module '@modulesvue.js' does not provide an export named &# 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742244154a2439022.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论