vueform / multiselect

Vue 3 multiselect component with single select, multiselect and tagging options (+Tailwind CSS support).
https://vueform.com
MIT License
808 stars 151 forks source link

Vue 2 Error: Cannot read properties of null (reading 'proxy') #326

Closed ag-coder closed 1 year ago

ag-coder commented 1 year ago

Version

Description

I updated from Vue version < 2.7 and get this error now?

[Vue warn]: Error in data(): "TypeError: Cannot read properties of null (reading 'proxy')"

According to the console log, it seems to be with the useDropdown function

const $this = getCurrentInstance().proxy;

jwoertink commented 1 year ago

I think I'm hitting the same issue.

TypeError: Object(...)() is null
    useDropdown http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:80833
    node_modules vueform/multiselect/dist/multiselect.vue2.js/resolveDeps/<@http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:81724
    resolveDeps http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:81719
    setup http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:82058
    mergedSetupFn http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:79367
    node_modules vue/composition-api/dist/vue-composition-api.mjs/mixin/initSetup/<@http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:79181
    activateCurrentInstance http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:79100
    initSetup http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:79179
    wrappedData http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:79162
    getData http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:198121
    initData http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:198085
    initState http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:198028
    _init http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:198411
    VueComponent http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:199536
    createComponentInstanceForVnode http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:198744
    init http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:198606
    createComponent http://localhost:3000/js/main.js?id=9ffb1d0c4a6fdc4b2dbb:200278

When I click in to the useDropdown, I see

function useDropdown (props, context, dep)
{
  const { disabled } = Object(vue__WEBPACK_IMPORTED_MODULE_0__["toRefs"])(props);

  const $this = Object(vue__WEBPACK_IMPORTED_MODULE_0__["getCurrentInstance"])().proxy;
ioannisgiannis commented 1 year ago

Same issue for me =(

adamberecz commented 1 year ago

This is usually the issue when you somehow have multiple Vue.js versions in your project. If you can't find the source try aliasing 'vue' to a single source within your project's node_modules folder.