noob saibotN
Convex Community14mo ago
6 replies
noob saibot

using push notifications component in monorepo with react native expo

Hi all. I am attempting to use the new convex component expo push notifications. I have a monorepo (using turbo-repo + pnpm) with 2 apps: a react-native expo (SDK 52) app and my convex backend. This is (roughly) the monorepo project structure
apps/
  convex/ 
  expo/
package.json

In my expo application, I import various functions from the expo-notifications lib. E.g to retrieve the push token:

import * as Notifications from "expo-notifications";
...
const token = await await Notifications.getExpoPushTokenAsync();


But I'm observing that if I install the convex dependency @convex-dev/expo-push-notifications in the monorepo, it seems to be messing up something with the expo-notifications lib in the client app because I get the following error at the import statement:
Cannot read property `prototype` of undefined

If I remove the convex dependency from the monorepo then the client app works again without issue. I can't tell if the issue is with my monorepo setup or something else. But this error occurs every time I install @convex-dev/expo-push-notifications as a dependency in the monorepo
IMG_9A3C18C1001F-1.jpeg
Was this page helpful?