-
Notifications
You must be signed in to change notification settings - Fork 222
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
[bug]: Could not find a declaration file for module '@algolia/client-search' in v5.2.2 #1544
[bug]: Could not find a declaration file for module '@algolia/client-search' in v5.2.2 #1544
Comments
Hey, thanks for reporting the issue! Could you please let me know which env (node or browser)? |
Types for 5.2.1: https://arethetypeswrong.github.io/?p=algoliasearch%405.2.1 |
Huge, thanks for the suggestion, I didn't knew that website. Bundling for node and browser is so complicated, sorry for the issues. I think I know why types are gone but it should resolve the ones from node/browser instead 🤔 |
|
import { liteClient } from 'algoliasearch/lite' No longer works with 5.2.3, works with 5.1.1. Node v20.17.0. Had to roll back algolia search update. :( ps - typescript project. |
Hey team! We just attempted to upgrade to 5.2.3 today and ran into the same issue.
It looks like you have found the cause of the issue, but as to why it breaks, it's not always determinable ahead of time if code is browser or node only (react server components or Nextjs for example) It looks like node recommends to use We had attempted to implement a pnpm patch for this, but ran into some CI/CD build issues stopping us, although changing browser back to default did solve our issue. |
Hey @Zach-Jaensch sorry for the issues, algolia/api-clients-automation#3640 have everything fixed up, I'll try to ship that today |
Amazing. Will try it out in the morning and let you know! |
Still seeing a problem with 5.2.4 - forgot to mention I am using pnpm 9.9.0 too. ▲ Next.js 14.2.7
- Environments: .env.local
- Experiments (use with caution):
· turbo
· webpackBuildWorker
Creating an optimized production build ...
✓ Compiled successfully
Linting and checking validity of types ..Failed to compile.
./src/components/search/Search.tsx:3:28
Type error: Cannot find module 'algoliasearch/lite' or its corresponding type declarations.
1 | 'use client'
2 |
> 3 | import { liteClient } from 'algoliasearch/lite'
| ^
4 | import { InstantSearch, useInstantSearch } from 'react-instantsearch'
5 |
6 | import { env } from '@/config/env.mjs'
ELIFECYCLE Command failed with exit code 1. |
Hey, yup nothing has changed in 5.2.4, algolia/api-clients-automation#3640 is not yet merged |
Hey there, I just released a 5.2.4-beta.2 version with a fix for this issue, if you have time, please try it out and let me know so I can go ahead with the PR :) Thanks |
@shortcuts Yay! It works again > [email protected]. Happy Labor Day! :) |
leeeeetsss goooooooooooo!! this will be released in stable tomorrow, happy labor day :) |
Can confirm 5.2.4-beta.2 works for us as well. Thanks for the fix! |
Sorry to bring more issues (can create a new issue if it is too unrelated) there appears to be missing type exports from the subdeps of algoliasearch. Here is the output of our nextjs app, and a minimum repo (vite react) to help with testing. Failed to compile.
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
Attempted import error: 'Region' is not exported from '@algolia/client-abtesting' (imported as 'ABTestingRegion').
Import trace for requested module:
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
./src/utils/algolia/client.ts
./src/utils/algolia/search.ts
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
Attempted import error: 'AbtestingClient' is not exported from '@algolia/client-abtesting' (imported as 'AbtestingClient').
Import trace for requested module:
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
./src/utils/algolia/client.ts
./src/utils/algolia/search.ts
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
Attempted import error: 'AdvancedSyntaxFeatures' is not exported from '@algolia/client-search' (imported as 'AdvancedSyntaxFeatures').
Import trace for requested module:
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
./src/utils/algolia/client.ts
./src/utils/algolia/search.ts
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
Attempted import error: 'AlternativesAsExact' is not exported from '@algolia/client-search' (imported as 'AlternativesAsExact').
Import trace for requested module:
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
./src/utils/algolia/client.ts
./src/utils/algolia/search.ts
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
Attempted import error: 'AnalyticsClient' is not exported from '@algolia/client-analytics' (imported as 'AnalyticsClient').
Import trace for requested module:
../../node_modules/.pnpm/[email protected]/node_modules/algoliasearch/dist/browser.js
./src/utils/algolia/client.ts
./src/utils/algolia/search.ts
> Build failed because of webpack errors |
ngl your 2 comments were an emotional rollercoaster @Zach-Jaensch................ but it's fixed in -beta.6 :D |
The fix has been released in 5.2.5! |
@shortcuts thanks! I can confirm that Are The Types Wrong? also reports successful checks for |
Thanks for testing!! I've also integrated attw and publint to our CI so we can make sure not to introduce regressions :D |
Sorry for the delay (had a busy week come out of nowhere), it works fine for us now. |
Description
Seems like the the issue of types not being included is back in v5.2.2. When I downgrade to 5.1.1, they are included.
Client
All
Version
5.2.2.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: