advanced-nova-media-library icon indicating copy to clipboard operation
advanced-nova-media-library copied to clipboard

Uncaught TypeError: GlobalVue.use is not a function

Open markcameron opened this issue 2 years ago • 11 comments

I've updated a project to use Nova 4, using 3.8.0 of this package, and when I load a resource with one of the Files:: fields I get the following error:

Uncaught TypeError: GlobalVue.use is not a function
    at Module.<anonymous> (media-lib-images-field:55622:13)
    at Module../node_modules/vuejs-clipper/src/clipper.js (media-lib-images-field:55627:30)
    at __webpack_require__ (media-lib-images-field:20:30)
    at Module../resources/js/field.js (media-lib-images-field:57984:71)
    at __webpack_require__ (media-lib-images-field:20:30)
    at Object.0 (media-lib-images-field:58022:1)
    at __webpack_require__ (media-lib-images-field:20:30)
    at media-lib-images-field:84:18
    at media-lib-images-field:87:10

Which seems to be from this file here https://github.com/ebess/advanced-nova-media-library/blob/master/dist/js/field.js

I'm not sure if it has something to do with the upgrade to Vue 3, and maybe the JS just needs to be rebuilt or something. (I don't even need to have a Files::make field on the resource, just having the ebess/advanced-nova-media-library installed is enough for the error to appear in the console.)

I also tried it on a fresh Laravel install with a fresh copy of Nova 4, and I also get the error and no field shows up in the resource edit or view.

markcameron avatar Apr 05 '22 14:04 markcameron

Thanks! I will check on it and report back soon.

-- Bertrand Kintanar @.*** On Apr 5, 2022, 10:58 PM +0800, Mark Cameron @.***>, wrote:

I've updated a project to use Nova 4, and when I load a resource with one of the Files:: fields I get the following error: Uncaught TypeError: GlobalVue.use is not a function at Module. (media-lib-images-field:55622:13) at Module../node_modules/vuejs-clipper/src/clipper.js (media-lib-images-field:55627:30) at webpack_require (media-lib-images-field:20:30) at Module../resources/js/field.js (media-lib-images-field:57984:71) at webpack_require (media-lib-images-field:20:30) at Object.0 (media-lib-images-field:58022:1) at webpack_require (media-lib-images-field:20:30) at media-lib-images-field:84:18 at media-lib-images-field:87:10 Which seems to be from this file here https://github.com/ebess/advanced-nova-media-library/blob/master/dist/js/field.js I'm not sure if it has something to do with the upgrade to Vue 3, and maybe the JS just needs to be rebuilt or something. (I don't even need to have a Files::make field on the resource, just having the ebess/advanced-nova-media-library installed is enough for the error to appear in the console.) I also tried it on a fresh Laravel install with a fresh copy of Nova 4, and I also get the error and no field shows up in the resource edit or view. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

bkintanar avatar Apr 05 '22 15:04 bkintanar

I believe need to update the webpack.mix.js file per the docs: https://nova.laravel.com/docs/4.0/upgrade.html#vue-3

Kussie avatar Apr 06 '22 03:04 Kussie

I'm trying to fix this but I'm having problems similar to this. laravel/nova-issues#3814

mertasan avatar Apr 06 '22 10:04 mertasan

any progress?

figurluk avatar Apr 08 '22 15:04 figurluk

@figurluk

I'm assuming this isn't a Nova bug and I'm trying to find the source of the problem.

I'm having the same issue with several packages. If I can fix this problem, I will have made several Nova packages compatible.

It could be something with the dependency versions, there may be an additional dependency that needs to be added, or I may be doing something wrong.

I'm currently trying to fix this problem with nova-sortable.

Please feel free to share your ideas.

mertasan avatar Apr 08 '22 15:04 mertasan

Same problem here after the upgrade. Will try to dive into this :)

larsjanssen6 avatar Apr 12 '22 13:04 larsjanssen6

Getting the same issue here!

xiCO2k avatar Apr 12 '22 19:04 xiCO2k

i found a problem but i don't know if it's a problem. Nova 4.0 use Vue 3, this extension use Vue 2 I don't know if this fix can help

TheNerka avatar Apr 13 '22 10:04 TheNerka

I note this which can be useful for migration to Vue 3 :

If you have an existing Vue 2 project or library that you intend to upgrade to Vue 3, we provide a build of Vue 3 that offers Vue 2 compatible APIs.

https://v3-migration.vuejs.org/#migration-build

illambo avatar Apr 14 '22 08:04 illambo

Just created PR which fixes basic feature of package for Nova 4, but because of unsupported third-party packages like vuejs-clipper i deleted it from my PR version

https://github.com/ebess/advanced-nova-media-library/pull/315

oleghalin avatar Apr 15 '22 10:04 oleghalin

@oleghalin Thanks for that, works like a charm since I don't need to cropping functionality

markcameron avatar Apr 15 '22 13:04 markcameron