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

React native tracker probably shouldn't have been published yet #1409

Open
pfulop opened this issue Jan 27, 2025 · 2 comments
Open

React native tracker probably shouldn't have been published yet #1409

pfulop opened this issue Jan 27, 2025 · 2 comments
Labels
type:defect Bugs or weaknesses. The issue has to contain steps to reproduce.

Comments

@pfulop
Copy link

pfulop commented Jan 27, 2025

Describe the bug
Seems like there's a 4.3.1 version of @snowplow/react-native-tracker published on npm. This is still pointing to the old documentation but what's worse it doesn't seem to be functional. While this version should be JS only, it seems to depended on some native package that causes error:

Error initializing tracker [Error: Native module not found]

Inspecting this it seems to be due to react-native-get-random-values. I think what's happening here is that the native dependencies of this package are not installed (at least not with expo, but I doubt it works with pure rn project), due to this being just a js library now. I assume this will be listed as a dependencies that consumers need to install on their own, but for now, it's hard to understand what's going on.

To Reproduce
Install @snowplow/react-native-tracker

Expected behavior
React native tracker should work.

Smartphone (please complete the following information):

  • Device: Android/iOS
  • OS: Any
  • Browser none
  • Version irrelevant
@pfulop pfulop added the type:defect Bugs or weaknesses. The issue has to contain steps to reproduce. label Jan 27, 2025
@matus-tomlein
Copy link
Contributor

Hi @pfulop, thanks for reporting this.

The react-native-get-random-values is listed as a dependency of the tracker and that should be provided in Expo Go, but might require running pod install under the dev build.

I have just tried to create a new Expo app and install the tracker and use it, but I don't see the same error as you stated.

Could you try running pod install whether that resolves the issue under iOS? Do you see the same on Android?

@pfulop
Copy link
Author

pfulop commented Jan 27, 2025

Interesting, I do see it as a dependency in the expo project. But looking at our yarn.lock, I see it only as a dependency of @snowplow/react-native-tracker. We're fully using expo-cli which doesn't let you install pods directly, instead, it uses a prebuild step.

Could you maybe see if the react-native-get-random-values in yarn.lock is a dependency of something else as well? Also, are you running it in Expo-go? I can imagine it works there since they bring react-native-get-random-values through some random/crypto libs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:defect Bugs or weaknesses. The issue has to contain steps to reproduce.
Projects
None yet
Development

No branches or pull requests

2 participants