Skip to content

React Native build issues due to ai dependency #6798

@WillyReyno

Description

@WillyReyno

🐛 Current behavior

Hello,

Since upgrading my Algolia packages, my Expo project build is failing due to an @vercel/oidc not being resolved, which is tied to the "ai" dependency recently added to your packages.

Upgrades done:

  • react-instantsearch-core 7.16.3 to 7.17.0 (ai added in 9e79c1f)
  • instantsearch-ui-components 0.11.2 to 0.12.0 (ai added in 4967237)
  • instantsearch.js from 4.80.0 to 4.81.0 (ai added in d7b360b)

Build error:

Metro has encountered an error: While trying to resolve module `@vercel/oidc` from file `/users/MyUser/MyApp/node_modules/@ai-sdk/gateway/dist/index.js`, the package `/users/MyUser/MyApp/node_modules/@vercel/oidc/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/users/MyUser/MyApp/node_modules/@vercel/oidc/index`. Indeed, none of these files exist:

  * /users/MyUser/MyApp/node_modules/@vercel/oidc/index(.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.mjs|.native.mjs|.mjs|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.cjs|.native.cjs|.cjs|.ios.scss|.native.scss|.scss|.ios.sass|.native.sass|.sass|.ios.css|.native.css|.css|.ios.css|.native.css|.css)
  * /users/MyUser/MyApp/node_modules/@vercel/oidc/index/index(.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.mjs|.native.mjs|.mjs|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.cjs|.native.cjs|.cjs|.ios.scss|.native.scss|.scss|.ios.sass|.native.sass|.sass|.ios.css|.native.css|.css|.ios.css|.native.css|.css): /users/MyUser/MyApp/node_modules/metro/src/node-haste/DependencyGraph.js (267:17)

  265 |         }
  266 |         if (error instanceof _metroResolver.InvalidPackageError) {
> 267 |           throw new _metroCore.PackageResolutionError({
      |                 ^
  268 |             packageError: error,
  269 |             originModulePath,
  270 |             targetModuleName: to,

It seems to be related to vercel/ai#9219 and the error disappears if I force "@ai-sdk/react": "^2.0.59" and "ai": "^5.0.59" as mentionned in a comment, but I think there might be something to fix in the dependencies of Algolia packages

Any help would be welcome!

🔍 Steps to reproduce

...

Live reproduction

None, sorry

💭 Expected behavior

App build should work without having to install additional dependencies / downgrading dependencies installed by Algolia packages.

Package version

instantsearch.js 4.81.0, instantsearch-ui-components 0.12.0, react-instantsearch-core 7.17.0

Operating system

macOS 26.1

Browser

None

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageIssues to be categorized by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions