[bug]: Lastest version of algoliasearch doesn't function on React Native apps

未关闭
#1,585 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react-native, typescript
领域
mobile

调研方向

首先,在使用 5.23.4 和 5.24.0 版本的 algoliasearch/lite 和 algoliasearch import 的 React Native 应用中复现初始化失败。检查 package 入口点和运行时导出;当两个客户端都能正确初始化,并且文档中记录的导出在 React Native 中正常工作时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug
Description

When I upgrade algoliasearch in my app from 4.24.0 to 5.23.4, both the lite client and the normal client throw exceptions on initialization. Does algolia 5.x not work with React Native?

It seems to be the case:

Lite version
  import { liteClient } from "algoliasearch/lite";
  const client =  liteClient(ALGOLIA_CONFIG.appId, algoliaToken);

Throws:

 TypeError: 0, _clientCommon.createNullLogger is not a function (it is undefined) (browser.js 265:29)
Full version
  import { algoliasearch } from "algoliasearch";
  const client = algoliasearch(ALGOLIA_CONFIG.appId, algoliaToken);

In this case, algoliasearch isn't even exported correctly at runtime (its types say it's available via ESM).

It Throws:

TypeError: 0, _algoliasearch.algoliasearch is not a function (it is undefined)

Ideally, I would like to use the non-lite version because we want to log engagement events back to algolia, and I don't think that is supported in the lite version. Please advise if this is a bug or if this sdk version isn't available for React Native

Client

Search

Version

5.23.4, 5.24.0

主要语言
TypeScript
星标
1.4k
派生
227
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

algolia/algoliasearch-client-javascript 的其他 Issue

查看 algolia/algoliasearch-client-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。