algolia / instantsearch

⚑️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.

Home Page:https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using InstantSearch in typescript requires to install places.js since v4.52.0

bidoubiwa opened this issue Β· comments

πŸ› Current behavior

When upgrading instantsearch.js to v.52 > with typescript, the places.js module is not found:

Cannot find module 'places.js' or its corresponding type declarations.

Similar to this issue: #4911 but with places.js.

When I add places.js in my packages, it works.

πŸ” Steps to reproduce

  1. open new directory
    In the terminal:
$ npm init -y
$ npx tsc --init
$ yarn add @types/node --save-dev
$ yarn add instantsearch.js 
  1. Create index.ts file with the following content:
import instantsearch from "instantsearch.js";

console.log(instantsearch)
  1. run npx tsc -p tsconfig.json

Live reproduction

https://github.com/bidoubiwa/instantsearch-v4.52.0-ts

πŸ’­ Expected behavior

No errors, or maybe add it in the peerDependencies

Package version

instantsearch.js 5.53.0

Operating system

macOs 13.2.1

Browser

/

Code of Conduct

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

This is very weird, I see no reason why this would be different between 4.51.1 and 4.52.0

Me neither, I looked at every commit to understand why but couldn't find anything relevant.

It was because of #5508 where the imports were ordered, but the ts-ignore for places didn't move with its corresponding import.

good catch! Thanks πŸ™