Closed OutdatedGuy closed 2 weeks ago
Hey @OutdatedGuy thanks for trying out the v5 client
I've not been able to reproduce the error, it compiles correctly on my side.
However from the error you shared, it seems like the peer dependencies of algoliasearch
are not installed. If they do not resolve automatically for you, it might be an exports
issue on our side.
Was it working with v4? You can also try to install them manually (@algolia/client-personalization
and so on), or use the umd
bundled file which contains them, usually for the browser env import {algoliasearch} from "algoliasearch/dist/algoliasearch.umd.js"
@shortcuts
Was it working with v4?
Yes. On v4 it was working flawlessly but since v5 I cannot build my project :(
You can also try to install them manually (
@algolia/client-personalization
and so on)
I installed the dependencies mentioned in the error logs with:
npm install @algolia/client-personalization @algolia/client-analytics @algolia/client-abtesting;
but still the same error occurs.
Hi,
we've encountered the same error, and we were able to work around it by modifying _node_modules/.pnpm/algoliasearch@5.1.1/nodemodules/algoliasearch/dist/algoliasearch/builds/node.d.ts
from this:
import type { AbtestingClient } from '@algolia/client-abtesting';
import type { Region as AbtestingRegion } from '@algolia/client-abtesting/src/abtestingClient';
import type { AnalyticsClient } from '@algolia/client-analytics';
import type { Region as AnalyticsRegion } from '@algolia/client-analytics/src/analyticsClient';
import type { ClientOptions } from '@algolia/client-common';
import type { PersonalizationClient } from '@algolia/client-personalization';
import type { Region as PersonalizationRegion } from '@algolia/client-personalization/src/personalizationClient';
import type { RecommendClient } from '@algolia/recommend';
import type { InitClientOptions, InitClientRegion, GenerateSecuredApiKeyOptions, GetSecuredApiKeyRemainingValidityOptions } from './models';
export * from './models';
export declare const apiClientVersion = "5.1.1";
to this:
import type { AbtestingClient } from '@algolia/client-abtesting';
import type { Region as AbtestingRegion } from '@algolia/client-abtesting/dist/src/abtestingClient';
import type { AnalyticsClient } from '@algolia/client-analytics';
import type { Region as AnalyticsRegion } from '@algolia/client-analytics/dist/src/analyticsClient';
import type { ClientOptions } from '@algolia/client-common';
import type { PersonalizationClient } from '@algolia/client-personalization';
import type { Region as PersonalizationRegion } from '@algolia/client-personalization/dist/src/personalizationClient';
import type { RecommendClient } from '@algolia/recommend';
import type { InitClientOptions, InitClientRegion, GenerateSecuredApiKeyOptions, GetSecuredApiKeyRemainingValidityOptions } from './models';
export * from './models';
export declare const apiClientVersion = "5.1.1";
since the import path does not match the folder structure
I have also managed to reproduce this using version "5.1.1"
.
Hey there, thanks for providing more context to the issue!
Could you please let me know if the latest version fixes the issue on your side?
@shortcuts I tried with the latest version (5.2.1) but having the same issue. So I looked into the error file and saw imports whose paths don't exist (@algolia/client-abtesting/src/abtestingClient). So I just updated code to import from base package and it worked.
Basically:
- import type { AbtestingClient } from '@algolia/client-abtesting';
- import type { Region as AbtestingRegion } from '@algolia/client-abtesting/src/abtestingClient';
+ import type { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';
Can you re-open the issue?
@shortcuts I tried with the latest version (5.2.1) but having the same issue. So I looked into the error file and saw imports whose paths don't exist (@algolia/client-abtesting/src/abtestingClient). So I just updated code to import from base package and it worked.
Basically:
- import type { AbtestingClient } from '@algolia/client-abtesting'; - import type { Region as AbtestingRegion } from '@algolia/client-abtesting/src/abtestingClient'; + import type { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';
Can you re-open the issue?
Hey, thanks for testing it! it was fixed in 5.2.2, could you retry please?
Hi, I tried 5.2.2 and it worked. Thanks.
Lets goooo enjoy!! Thanks you
Steps to reproduce:
tsc
commandSee below error
Things Already Tried
npm install
andnpm update
node_modules
dir and reinstalling npm pacages