dobromir-hristov / vue-vimeo-player

Vue.js wrapper for Vimeo player
MIT License
111 stars 56 forks source link

Runing with Nuxt - Missing Jquery? #90

Open flaviocordova opened 2 years ago

flaviocordova commented 2 years ago

I've followed the instructions for using vue-vimeo-player with nuxt but it seems it still misses something related to JQuery:

On console I get this:

This dependency was not found:                                                                              friendly-errors 19:55:01
                                                                                                            friendly-errors 19:55:01
* __webpack_provided_window_dot_jQuery in ./node_modules/@vimeo/player/dist/player.es.js                    friendly-errors 19:55:01
                                                                                                            friendly-errors 19:55:01
To install it, you can run: npm install --save __webpack_provided_window_dot_jQuery                         friendly-errors 19:55:01

and on browser I get this message:

ERROR in ./node_modules/@vimeo/player/dist/player.es.js
Module not found: Error: Can't resolve 'jquery' in '<path>/node_modules/@vimeo/player/dist'

Is there any best practice to fix it? Probably it should be added to the docs.

flaviocordova commented 2 years ago

I also get a warning:

<src-path>/plugins/vimeo-player.js
  2:8  warning  Using exported name 'vueVimeoPlayer' as identifier for default export  import/no-named-as-default

I fixed it changing the import in plugin to:

import { vueVimeoPlayer } from 'vue-vimeo-player'

Not sure if it's right since I'm still having the jquery problem above.

flaviocordova commented 2 years ago

I had this on my nuxt.config.js

build: {
  plugins: {
      // set shortcuts as global for bootstrap
      new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'window.jQuery': 'jquery',
      }),
  }
}

I removed this code and it seems to work now

dobromir-hristov commented 2 years ago

There is no jQuery dependency in this package.

dobromir-hristov commented 2 years ago

At least no one ever complained or had to install it. Very odd.