Skip to content
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]: TypeError: algoliasearch is not a function #1558

Closed
AdamBCo opened this issue Oct 2, 2024 · 1 comment
Closed

[bug]: TypeError: algoliasearch is not a function #1558

AdamBCo opened this issue Oct 2, 2024 · 1 comment
Labels

Comments

@AdamBCo
Copy link

AdamBCo commented Oct 2, 2024

Description

When I include the following code in a .js file, I get the following RESULT

const algoliasearch = require("algoliasearch");
const algoliaClient = algoliasearch(
  process.env.ALGOLIA_APP_ID,
  process.env.ALGOLIA_APP_SECRET,
);

RESULT:
TypeError: algoliasearch is not a function

Client

All

Version

5.7.0

Relevant log output

No response

@AdamBCo AdamBCo added the bug label Oct 2, 2024
@millotp
Copy link
Contributor

millotp commented Oct 3, 2024

Hello,
If you look at the example in the doc, you need to use:

import { algoliasearch } from "algoliasearch";

or

const { algoliasearch } = require("algoliasearch");

@millotp millotp closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants