Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

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

Open
luandiego7 opened this issue May 2, 2022 · 7 comments

Comments

@luandiego7
Copy link

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

@vivazzi
Copy link

vivazzi commented May 23, 2022

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
Copy link

vivazzi commented May 24, 2022

I was able to find a solution to the bug and I created pull request #61. In comment I described about the bug more detail

@vivazzi
Copy link

vivazzi commented May 27, 2022

Unfortunately, my pull request #61 does not completely solve this problem. More details: #61 (comment)

@jacoherotel
Copy link

same here

@mimbar
Copy link

mimbar commented Sep 4, 2022

i add this in vite.config.js. Reference

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

but it lead to another problem
image

anyone?

@vivazzi
Copy link

vivazzi commented Sep 15, 2022

@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

@mimbar
Copy link

mimbar commented Sep 15, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants