Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue3 Support #123

Closed
Luigidefra opened this issue Feb 16, 2021 · 14 comments · Fixed by #172
Closed

Vue3 Support #123

Luigidefra opened this issue Feb 16, 2021 · 14 comments · Fixed by #172
Labels
help wanted Extra attention is needed vue Only applies to the autocomplete-vue package

Comments

@Luigidefra
Copy link

Packages doesn't seems run with Vue3, will you update it?

@trevoreyre
Copy link
Owner

Do you have some examples of the errors you're seeing in Vue 3? I haven't tried it in v3 yet.

@trevoreyre trevoreyre added help wanted Extra attention is needed vue Only applies to the autocomplete-vue package labels Feb 17, 2021
@rmzg
Copy link

rmzg commented Mar 8, 2021

Just a random example of errors:

runtime-core.esm-bundler.js:159 [Vue warn]: `beforeDestroy` has been renamed to `beforeUnmount`. 
  at <Autocomplete search=fn<bound search> > 
  at <SearchInput>
warn @ runtime-core.esm-bundler.js:159
applyOptions @ runtime-core.esm-bundler.js:5960
finishComponentSetup @ runtime-core.esm-bundler.js:6606
setupStatefulComponent @ runtime-core.esm-bundler.js:6539
setupComponent @ runtime-core.esm-bundler.js:6479
mountComponent @ runtime-core.esm-bundler.js:4219
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
mountChildren @ runtime-core.esm-bundler.js:3995
mountElement @ runtime-core.esm-bundler.js:3918
processElement @ runtime-core.esm-bundler.js:3899
patch @ runtime-core.esm-bundler.js:3819
componentEffect @ runtime-core.esm-bundler.js:4312
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
render @ runtime-core.esm-bundler.js:4895
mount @ runtime-core.esm-bundler.js:3135
app.mount @ runtime-dom.esm-bundler.js:1431
eval @ main.ts:41
eval @ main.ts:40
eval @ main.ts:34
./src/main.ts @ vC.umd.js:1815
__webpack_require__ @ vC.umd.js:30
eval @ entry-lib-no-default.js:3
./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js @ vC.umd.js:202
__webpack_require__ @ vC.umd.js:30
(anonymous) @ vC.umd.js:94
(anonymous) @ vC.umd.js:97
webpackUniversalModuleDefinition @ vC.umd.js:9
(anonymous) @ vC.umd.js:10
Show 4 more frames
runtime-core.esm-bundler.js:159 [Vue warn]: Property "$createElement" was accessed during render but is not defined on instance. 
  at <Autocomplete search=fn<bound search> > 
  at <SearchInput>
warn @ runtime-core.esm-bundler.js:159
get @ runtime-core.esm-bundler.js:6244
__vue_render__ @ autocomplete.esm.js:632
renderComponentRoot @ runtime-core.esm-bundler.js:828
componentEffect @ runtime-core.esm-bundler.js:4294
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
mountChildren @ runtime-core.esm-bundler.js:3995
mountElement @ runtime-core.esm-bundler.js:3918
processElement @ runtime-core.esm-bundler.js:3899
patch @ runtime-core.esm-bundler.js:3819
componentEffect @ runtime-core.esm-bundler.js:4312
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
render @ runtime-core.esm-bundler.js:4895
mount @ runtime-core.esm-bundler.js:3135
app.mount @ runtime-dom.esm-bundler.js:1431
eval @ main.ts:41
eval @ main.ts:40
eval @ main.ts:34
./src/main.ts @ vC.umd.js:1815
__webpack_require__ @ vC.umd.js:30
eval @ entry-lib-no-default.js:3
./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js @ vC.umd.js:202
__webpack_require__ @ vC.umd.js:30
(anonymous) @ vC.umd.js:94
(anonymous) @ vC.umd.js:97
webpackUniversalModuleDefinition @ vC.umd.js:9
(anonymous) @ vC.umd.js:10
Show 7 more frames
runtime-core.esm-bundler.js:159 [Vue warn]: Property "_self" was accessed during render but is not defined on instance. 
  at <Autocomplete search=fn<bound search> > 
  at <SearchInput>
warn @ runtime-core.esm-bundler.js:159
get @ runtime-core.esm-bundler.js:6244
__vue_render__ @ autocomplete.esm.js:632
renderComponentRoot @ runtime-core.esm-bundler.js:828
componentEffect @ runtime-core.esm-bundler.js:4294
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
mountChildren @ runtime-core.esm-bundler.js:3995
mountElement @ runtime-core.esm-bundler.js:3918
processElement @ runtime-core.esm-bundler.js:3899
patch @ runtime-core.esm-bundler.js:3819
componentEffect @ runtime-core.esm-bundler.js:4312
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
render @ runtime-core.esm-bundler.js:4895
mount @ runtime-core.esm-bundler.js:3135
app.mount @ runtime-dom.esm-bundler.js:1431
eval @ main.ts:41
eval @ main.ts:40
eval @ main.ts:34
./src/main.ts @ vC.umd.js:1815
__webpack_require__ @ vC.umd.js:30
eval @ entry-lib-no-default.js:3
./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js @ vC.umd.js:202
__webpack_require__ @ vC.umd.js:30
(anonymous) @ vC.umd.js:94
(anonymous) @ vC.umd.js:97
webpackUniversalModuleDefinition @ vC.umd.js:9
(anonymous) @ vC.umd.js:10
Show 7 more frames
runtime-core.esm-bundler.js:159 [Vue warn]: Unhandled error during execution of render function 
  at <Autocomplete search=fn<bound search> > 
  at <SearchInput>
warn @ runtime-core.esm-bundler.js:159
logError @ runtime-core.esm-bundler.js:332
handleError @ runtime-core.esm-bundler.js:324
renderComponentRoot @ runtime-core.esm-bundler.js:937
componentEffect @ runtime-core.esm-bundler.js:4294
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
mountChildren @ runtime-core.esm-bundler.js:3995
mountElement @ runtime-core.esm-bundler.js:3918
processElement @ runtime-core.esm-bundler.js:3899
patch @ runtime-core.esm-bundler.js:3819
componentEffect @ runtime-core.esm-bundler.js:4312
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
render @ runtime-core.esm-bundler.js:4895
mount @ runtime-core.esm-bundler.js:3135
app.mount @ runtime-dom.esm-bundler.js:1431
eval @ main.ts:41
eval @ main.ts:40
eval @ main.ts:34
./src/main.ts @ vC.umd.js:1815
__webpack_require__ @ vC.umd.js:30
eval @ entry-lib-no-default.js:3
./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js @ vC.umd.js:202
__webpack_require__ @ vC.umd.js:30
(anonymous) @ vC.umd.js:94
(anonymous) @ vC.umd.js:97
webpackUniversalModuleDefinition @ vC.umd.js:9
(anonymous) @ vC.umd.js:10
Show 7 more frames
runtime-core.esm-bundler.js:338 Uncaught TypeError: Cannot read property '_c' of undefined
    at Proxy.__vue_render__ (autocomplete.esm.js:632)
    at renderComponentRoot (runtime-core.esm-bundler.js:828)
    at componentEffect (runtime-core.esm-bundler.js:4294)
    at reactiveEffect (reactivity.esm-bundler.js:71)
    at effect (reactivity.esm-bundler.js:46)
    at setupRenderEffect (runtime-core.esm-bundler.js:4277)
    at mountComponent (runtime-core.esm-bundler.js:4235)
    at processComponent (runtime-core.esm-bundler.js:4195)
    at patch (runtime-core.esm-bundler.js:3822)
    at mountChildren (runtime-core.esm-bundler.js:3995)
__vue_render__ @ autocomplete.esm.js:632
renderComponentRoot @ runtime-core.esm-bundler.js:828
componentEffect @ runtime-core.esm-bundler.js:4294
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
mountChildren @ runtime-core.esm-bundler.js:3995
mountElement @ runtime-core.esm-bundler.js:3918
processElement @ runtime-core.esm-bundler.js:3899
patch @ runtime-core.esm-bundler.js:3819
componentEffect @ runtime-core.esm-bundler.js:4312
reactiveEffect @ reactivity.esm-bundler.js:71
effect @ reactivity.esm-bundler.js:46
setupRenderEffect @ runtime-core.esm-bundler.js:4277
mountComponent @ runtime-core.esm-bundler.js:4235
processComponent @ runtime-core.esm-bundler.js:4195
patch @ runtime-core.esm-bundler.js:3822
render @ runtime-core.esm-bundler.js:4895
mount @ runtime-core.esm-bundler.js:3135
app.mount @ runtime-dom.esm-bundler.js:1431
eval @ main.ts:41
eval @ main.ts:40
eval @ main.ts:34
./src/main.ts @ vC.umd.js:1815
__webpack_require__ @ vC.umd.js:30
eval @ entry-lib-no-default.js:3
./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js @ vC.umd.js:202
__webpack_require__ @ vC.umd.js:30
(anonymous) @ vC.umd.js:94
(anonymous) @ vC.umd.js:97
webpackUniversalModuleDefinition @ vC.umd.js:9
(anonymous) @ vC.umd.js:10
Show 5 more frames

@vitality82
Copy link

Some of those are breaking changes. Any plans to migrate to Vue3?

@bci24
Copy link

bci24 commented Nov 30, 2021

any news ?

@salsoftsafeeullahsarhandi

@trevoreyre any luck for this?

@dustinmichels
Copy link

Hi there! I think I'm also having vue3 issues.

I tried using autocomplete within a vue3 component like this:

<script lang="ts">
import { defineComponent } from 'vue'

import Autocomplete from '@trevoreyre/autocomplete-vue'

export default defineComponent({
  components: {
    Autocomplete,
  },
  methods: {
    search(input: string) {
      const countries = ['Germany', 'United States of America', 'Sweden']
      if (input.length < 1) {
        return []
      }
      return countries.filter((country) => {
        return country.toLowerCase().startsWith(input.toLowerCase())
      })
    },
  },
})
</script>

<template>
  <autocomplete
    :search="search"
    placeholder="Search for a country"
    aria-label="Search for a country"
  />
</template>

I can't get it to work. Some errors I see:

[Vue warn]: Property "$createElement" was accessed during render but is not defined on instance. 
  at <Autocomplete search=fn<bound search> placeholder="Search for a country" aria-label="Search for a country" > 
  at <Search> 
  at <App> [runtime-core.esm-bundler.js:38:16](http://127.0.0.1:5173/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js)
[Vue warn]: Property "_self" was accessed during render but is not defined on instance. 
  at <Autocomplete search=fn<bound search> placeholder="Search for a country" aria-label="Search for a country" > 
  at <Search> 
  at <App> [runtime-core.esm-bundler.js:38:16](http://127.0.0.1:5173/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js)
[Vue warn]: Unhandled error during execution of render function 
  at <Autocomplete search=fn<bound search> placeholder="Search for a country" aria-label="Search for a country" > 
  at <Search> 
  at <App>

Any thoughts?

Thanks!!

@salsoftsafeeullahsarhandi

Hi there! I think I'm also having vue3 issues.

I tried using autocomplete within a vue3 component like this:

<script lang="ts">
import { defineComponent } from 'vue'

import Autocomplete from '@trevoreyre/autocomplete-vue'

export default defineComponent({
  components: {
    Autocomplete,
  },
  methods: {
    search(input: string) {
      const countries = ['Germany', 'United States of America', 'Sweden']
      if (input.length < 1) {
        return []
      }
      return countries.filter((country) => {
        return country.toLowerCase().startsWith(input.toLowerCase())
      })
    },
  },
})
</script>

<template>
  <autocomplete
    :search="search"
    placeholder="Search for a country"
    aria-label="Search for a country"
  />
</template>

I can't get it to work. Some errors I see:

[Vue warn]: Property "$createElement" was accessed during render but is not defined on instance. 
  at <Autocomplete search=fn<bound search> placeholder="Search for a country" aria-label="Search for a country" > 
  at <Search> 
  at <App> [runtime-core.esm-bundler.js:38:16](http://127.0.0.1:5173/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js)
[Vue warn]: Property "_self" was accessed during render but is not defined on instance. 
  at <Autocomplete search=fn<bound search> placeholder="Search for a country" aria-label="Search for a country" > 
  at <Search> 
  at <App> [runtime-core.esm-bundler.js:38:16](http://127.0.0.1:5173/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js)
[Vue warn]: Unhandled error during execution of render function 
  at <Autocomplete search=fn<bound search> placeholder="Search for a country" aria-label="Search for a country" > 
  at <Search> 
  at <App>

Any thoughts?

Thanks!!

@dustinmichels many things has been changed for Vue3 core apis and this package not compatible

@sunujacob
Copy link

Any updates?

@marsidev
Copy link

bump

@sebbayer
Copy link
Contributor

currently working on it.

@sebbayer
Copy link
Contributor

sebbayer commented Apr 2, 2024

please update @trevoreyre/autocomplete-vue to at least 3.0.1 for Vue 3 support.

@develth
Copy link

develth commented Jul 29, 2024

example is broken, does not work

@sebbayer
Copy link
Contributor

@develth you mean the Codepen examples in the documentation, right?
@trevoreyre if you read this, I would like to kindly ask you to update all the Codepen examples so they embed the latest Vue 3 Javascript, as I don't have access to those Codepens. Currently they include Vue 2.6.6. That should fix it.

@develth
Copy link

develth commented Jul 30, 2024

@develth you mean the Codepen examples in the documentation, right?

Yes. Sorry for not pointing that out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed vue Only applies to the autocomplete-vue package
Projects
None yet
Development

Successfully merging a pull request may close this issue.