instantsearch icon indicating copy to clipboard operation
instantsearch copied to clipboard

Async component <Highlight> should be explicitly created via defineAsyncComponent() in Vue 3

Open josefarrugia opened this issue 10 months ago • 7 comments

🐛 Current behavior

Hello there,

I am getting the following Vue warning error message when using the AisHighlight component in Vue 3.4.21 whilst entering characters in my search field. There are no results being shown too. This works on Vue 2.7.16.

[Vue warn]: (deprecation COMPONENT_ASYNC) Async component <Highlight> should be explicitly created via `defineAsyncComponent()` in Vue 3. Plain functions will be treated as functional components in non-compat build. If you have already migrated all async component usage and intend to use plain functions for functional components, you can disable the compat behavior and suppress this warning with:

configureCompat({ COMPONENT_ASYNC: false })

Details: https://v3-migration.vuejs.org/breaking-changes/async-components.html 

Here's a snippet of my import statements:

import {
  AisAutocomplete,
  AisConfigure,
  AisHighlight,
  AisInstantSearch,
} from 'vue-instantsearch/vue3/es';

I am also getting the following warning message:

Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core . 
  at <AisAutocomplete> 
  at <AisInstantSearch

Any thoughts?

🔍 Steps to reproduce

  1. Create Vue 3.4.21 app
  2. Install npm install algoliasearch vue-instantsearch
  3. Setup algolia
  4. Import the following components AisAutocomplete, AisConfigure, AisHighlight, AisInstantSearch, to your Vue template
  5. Initiate a search
  6. Take note of the Vue warning message in the console: Vue warn]: (deprecation COMPONENT_ASYNC) Async component <Highlight> should be explicitly created via defineAsyncComponent() in Vue 3

Live reproduction

no link at the moment

💭 Expected behavior

Hits should be displayed whilst typing in a few characters.

Package version

[email protected], [email protected]

Operating system

No response

Browser

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

josefarrugia avatar Apr 08 '24 08:04 josefarrugia

Hm, this may be a breaking change in Vue. I know it definitely works in older vue versions, like 3.2.4 here https://github.com/algolia/doc-code-samples/blob/master/vue-instantsearch/vue3-vite/yarn.lock#L642 (or 3.2.47 elsewhere). From which vue version are you able to reproduce this?

Haroenv avatar Apr 15 '24 15:04 Haroenv

@Haroenv [email protected]

josefarrugia avatar Apr 15 '24 15:04 josefarrugia

Yes, I read the original text, but with older vue versions it definitely works. Does 3.4.0 for example have that error already?

Haroenv avatar Apr 15 '24 15:04 Haroenv

@Haroenv apologies I misread your original message. So I have dropped down the following packages, [email protected], @vue/[email protected] and @vue/[email protected], and it's still producing the same warning message:

[Vue warn]: (deprecation RENDER_FUNCTION) Vue 3's render function API has changed. You can opt-in to the new API with:

configureCompat({ RENDER_FUNCTION: false })

josefarrugia avatar Apr 16 '24 08:04 josefarrugia

@josefarrugia happy to look into it, but require a minimal reproduction. Can you provide it?

Rigo-m avatar Apr 17 '24 09:04 Rigo-m

@Rigo-m sure, what particular files would you like to see and how do I go about sharing it with you?

josefarrugia avatar Apr 17 '24 10:04 josefarrugia

Can you provide a public repository with a minimal setup that reproduces the behavior?

Rigo-m avatar Apr 17 '24 11:04 Rigo-m