vue-select2
vue-select2 copied to clipboard
Vue.js 3 - problem jquery - does not provide an export named 'default'
Hello guys. I'm facing this problem with jquery plugin when i try use this select2.
My dependencies:
I have same problem.
My dependencies:
{
"name": "vl",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "vite --host",
"build": "vite build",
"serve": "vite preview"
},
"dependencies": {
"axios": "^0.24.0",
"lodash": "^4.17.21",
"path": "^0.12.7",
"vue": "^3.2.16",
"vue-i18n": "^9.0.0-beta.17",
"vue-router": "^4.0.2",
"vue-spinner": "^1.0.4",
"vue3-select2-component": "^0.1.7"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.9.3",
"sass": "^1.45.0",
"vite": "^2.6.4"
}
}
Early I used webpack and I did not have this bug.
I was able to find a solution to the bug and I created pull request https://github.com/godbasin/vue-select2/pull/61. In comment I described about the bug more detail
Unfortunately, my pull request https://github.com/godbasin/vue-select2/pull/61 does not completely solve this problem. More details: https://github.com/godbasin/vue-select2/pull/61#issuecomment-1139314582
same here
i add this in vite.config.js. Reference
optimizeDeps: {
include: ['linked-dep', 'Select2', 'jquery']
},
but it lead to another problem
anyone?
@mimbar I think we need to refuse of jQuery and its plugins, because Vue has all that we need to create different plugins. For example, for select there is vue-select, https://github.com/sagalbot/vue-select
@vivazzi that's right. after considering the impact, i chose to move on from jquery and used everything that built using vue.