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

Failed to resolve plugin for module "@sentry/react-native/expo" #4283

Closed
nawbar23 opened this issue Nov 17, 2024 · 14 comments
Closed

Failed to resolve plugin for module "@sentry/react-native/expo" #4283

nawbar23 opened this issue Nov 17, 2024 · 14 comments

Comments

@nawbar23
Copy link

nawbar23 commented Nov 17, 2024

What React Native libraries do you use?

Expo (mobile only) (52.0.7)

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.1.0

How does your development environment look like?

(node:14112) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
Memory: 16.51 GB / 31.69 GB
Binaries:
Node:
version: 22.11.0
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 10.9.0
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java: Not Found
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 15.1.2
wanted: ^15.1.2
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.2
wanted: 0.76.2
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

Sentry.init()

Sentry.init({
dsn: "https://ae458ee624bf9a970fdc32e7634a536b:f43243fb1d8e637a71e7125ca4fa7b22@o4506953980444672.ingest.us.sentry.io/4506953985753088",
tracesSampleRate: 0.2,
enabled: !DEV,
});

Steps to Reproduce

  1. Run npx expo start --tunnel

Expected Result

Successful build

Actual Result

Starting project at xxx
env: load .env.local
env: export SENTRY_AUTH_TOKEN
PluginError: Failed to resolve plugin for module "@sentry/react-native/expo" relative to xxx

@oussamakh96
Copy link

I got the same error

@kebabmestarn
Copy link

Facing the same issue with trying to upgrade to Expo SDK 52

@GamingHazard
Copy link

Facing the same issue with trying to upgrade to Expo SDK 52

as a matter of fact, implimented sentry in my 49 expo SDK and it worked, but i think its just a bug that hasnt yet brrn fixed by sentry

@oussamakh96
Copy link

Worked only on SDK 51 but I got the error when I upgrade to SDK 52

@krystofwoldrich
Copy link
Member

Hello everyone,

thank you for letting us know, sadly we have not reproduced this yet,

can you check if the node_modules/@sentry/react-native/expo.js exists in your node_modules?

@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Nov 19, 2024
@krystofwoldrich krystofwoldrich self-assigned this Nov 19, 2024
@GamingHazard
Copy link

GamingHazard commented Nov 19, 2024 via email

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 19, 2024
@GamingHazard
Copy link

GamingHazard commented Nov 19, 2024 via email

@henribru
Copy link

I'm having this problem on Windows, but it works fine on Linux in WSL2

@nawbar23
Copy link
Author

nawbar23 commented Nov 19, 2024

@krystofwoldrich in my case node_modules/@sentry/react-native/expo.js exists
and contains:
module.exports = require('./plugin/build');

@jerone
Copy link

jerone commented Nov 19, 2024

Issue created on the Expo repo with reproduction: expo/expo#33054

byCedric added a commit to expo/expo that referenced this issue Nov 20, 2024
…n Windows (#33106)

# Why

Fixes #33054, getsentry/sentry-react-native#4283

# How

When using nested module specifiers as config plugin, we need to use the
forward slash (even on Windows) -- as we are resolving module
specifiers, not actual file paths.

This fixes that to properly resolve `@sentry/react-native/expo`
references on Windows.

# Test Plan

- `git clone https://github.com/jerone/expo-doctor-sentry`
- `cd expo-doctor-sentry`
- `npm ci`
- `npx expo config`
- Should work on Windows

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@Abdeldmh
Copy link

Hello, when will it be released please ?

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Nov 20, 2024

Thank you @jerone for opening the Expo issue and supplying the repro.

@Abdeldmh The fix was merged in expo/expo#33106 and likely will be in the next Expo SDK hotfix release.

At the moment you can use @sentry/react-native in the app.json or use JS/TS app configuration where you can directly import @sentry/react-native/expo. But note that in that case sentry-expo-upload-sourcemaps won't automatically use the org and project specified.


Note: @sentry/react-native/expo is not a standalone package, but sub export from @sentry/react-native.

@krystofwoldrich krystofwoldrich moved this from Needs Investigation to Done in Mobile & Cross Platform SDK Nov 20, 2024
@krystofwoldrich krystofwoldrich moved this from Done to Needs Validation in Mobile & Cross Platform SDK Nov 20, 2024
@krystofwoldrich
Copy link
Member

Waiting for release of expo/expo#33106 before closing this issue.

@krystofwoldrich
Copy link
Member

The changes were released in https://www.npmjs.com/package/expo/v/52.0.9

@github-project-automation github-project-automation bot moved this from Needs Validation to Done in Mobile & Cross Platform SDK Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

No branches or pull requests

8 participants