algolia / instantsearch

⚑️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.59k stars 503 forks source link

Installation problem: Property 'MarkerOptions' does not exist on type 'typeof maps'' #6253

Open Annoxis opened 6 days ago

Annoxis commented 6 days ago

πŸ› Current behavior

I get the following error at instantsearch.js/es/widgets/geo-search/geo-search.d.ts:213:63 : Property 'MarkerOptions' does not exist on type 'typeof maps'. Here is the faulty line of code: markerOptions: GeoSearchMarker<typeof google.maps.MarkerOptions | Partial<HTMLMarkerArguments>>;

Removing "typeof" fixes the issue as a workaround for development, but it won't be applicable in production.

πŸ” Steps to reproduce

Simply download the relevant libraries, start a basic angular project and attempt to launch the front end. I am sorry, I have not been able to run the codesandbox online, but it worked locally.

Live reproduction

https://codesandbox.io/p/github/Annoxis/instantsearch_googlemaps_import_problem/main

πŸ’­ Expected behavior

My front end compile.

Package version

Instantsearch.js 4.72.2, types/google.maps 3.55.10, angular 15.2, npm 10.5.0

Operating system

Tested under Mac Sonoma and Windows 11 (WSL 2)

Browser

Irrelevant

Code of Conduct

Haroenv commented 6 days ago

Your sandbox seems to be private, but I tried to reproduce and I don't see an error: https://codesandbox.io/p/sandbox/friendly-ben-jzt2xs?file=%2Fsearch.ts%3A100%2C1-111%2C6

Annoxis commented 5 days ago

@Haroenv I updated the codesandbox, it should work now. The main difference between our codes is that I am using Angular and you are not.