vue-select2 icon indicating copy to clipboard operation
vue-select2 copied to clipboard

Vue.js 3 - problem jquery - does not provide an export named 'default'

Open luandiego7 opened this issue 2 years ago • 7 comments

Hello guys. I'm facing this problem with jquery plugin when i try use this select2.

Captura de Tela 2022-05-02 às 20 48 43

Captura de Tela 2022-05-02 às 20 47 59

My dependencies:

Captura de Tela 2022-05-02 às 20 51 04

luandiego7 avatar May 02 '22 23:05 luandiego7

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.

vivazzi avatar May 23 '22 14:05 vivazzi

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

vivazzi avatar May 24 '22 06:05 vivazzi

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

vivazzi avatar May 27 '22 06:05 vivazzi

same here

jacoherotel avatar Jul 21 '22 08:07 jacoherotel

i add this in vite.config.js. Reference

optimizeDeps: {
        include: ['linked-dep', 'Select2', 'jquery']
},

but it lead to another problem image

anyone?

mimbar avatar Sep 04 '22 08:09 mimbar

@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 avatar Sep 15 '22 03:09 vivazzi

@vivazzi that's right. after considering the impact, i chose to move on from jquery and used everything that built using vue.

mimbar avatar Sep 15 '22 04:09 mimbar