sagalbot / vue-select

Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.
https://vue-select.org
MIT License
4.62k stars 1.33k forks source link

Uncaught RerenceError: vSelect is not defined in "vue-select": "^4.0.0-beta.6" #1730

Closed srsimonson closed 1 year ago

srsimonson commented 1 year ago

Installed "vue-select": "^4.0.0-beta.6"

When sourcing in vue-select.umd.js and registering the component as per the documentation:

Then, import and register the component: Vue.component("v-select", vSelect);

I get the error:

Uncaught RerenceError: vSelect is not defined

The problem is in the second line ... ||self,t["vue-select"]=a(t.Vue))}) ...

Changing the way the component is registered to match the code does not work, as Vue.component("v-select", vue-select); throws an error as well because the - is a breaking character.

The solution for me was to change ... ||self,t["vue-select"]=a(t.Vue))}) ... to ... ||self,t["vSelect"]=a(t.Vue))}) ... where "vue-select" changes to "vSelect" to match the documentation and remove the breaking character. Then I was successfully able to register the component.

sagalbot commented 1 year ago

Sorry about that, the docs are really out of date for the beta. I'm rebuilding them with Nuxt, almost done now. Here's an example using the UMD version.

https://codepen.io/sagalbot/pen/NpwrQO

srsimonson commented 1 year ago

Thanks for the response, however implementing as per this codepen a new error appears.

[Vue warn]: Failed to resolve component: v-select If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at

The change I mentioned in my issue successfully resolved it for me.

On Fri, Dec 16, 2022 at 10:21 AM Jeff Sagal @.***> wrote:

Closed #1730 https://github.com/sagalbot/vue-select/issues/1730 as completed.

— Reply to this email directly, view it on GitHub https://github.com/sagalbot/vue-select/issues/1730#event-8058081295, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMJN5TT6TNMXKCWPGYTCDTWNSJJZANCNFSM6AAAAAATBE2LLY . You are receiving this because you authored the thread.Message ID: @.***>

-- steve