#community-help

Issue with TypesenseInstantSearchAdapter after Angular Update

TLDR Ivan reports an error with TypesenseInstantSearchAdapter after updating to Angular 15. Jason suggests creating a minimal replicate project for further investigation.

Powered by Struct AI
+11
Dec 01, 2022 (10 months ago)
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
10:32 AM
Hi Jason 👋I hope you can help, we updated our project to use angular 15 and typesense-instantsearch-adapter 2.4.2. But now i am getting error
ERROR TypeError: typesense_instantsearch_adapter__WEBPACK_IMPORTED_MODULE_2__ is not a constructor
I didn't change anything, so syntax like you provided in example:
import TypesenseInstantSearchAdapter from 'typesense-instantsearch-adapter';
const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter(options)

Found familiar github issue, but there no answers
https://github.com/typesense/typesense-instantsearch-adapter/issues/105
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:45 PM
I briefly looked into that issue, but it seemed like it would require a non-trivial amount of changes back when the library was written in JS. Now that we’ve converted it into Typescript, I wonder if it is any easier.

Are you able to share a minimal project that I can use to replicate the issue and then test any potential fixes?
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
05:12 PM
it will be hard, i also didn't mention that the problem is that i use typesense adapter in component inside our custom libriory, it bilds ok, but when i try to use it in angular project it throws error. If i create same component in project it works ok, but throw libriory - no. Everything was ok on angular 11, but after update to 15 it started to throw error
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:13 PM
Can you create a standalone angular 15 project, with a basic search field and see if you can replicate the issue there?
Ivan
Photo of md5-bcbe2a4c9402d7445badbcf2ebdc68f8
Ivan
05:15 PM
ok, i will try it tomorrow, today is already late, thank you for reply🙂
+11