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

Error: You attempted to set the key sdk with the value #347

Closed
pkayfire opened this issue Jun 17, 2023 · 21 comments · Fixed by #350
Closed

Error: You attempted to set the key sdk with the value #347

pkayfire opened this issue Jun 17, 2023 · 21 comments · Fixed by #350

Comments

@pkayfire
Copy link

Summary

Getting the following error when updating App.tsx on a Expo development build with sentry-expo.

 WARN  [sentry-expo] Disabling the Sentry Native SDK (all JS errors will still be reported).
To enable it, run 'yarn add @sentry/react-native' or 'npm install @sentry/react-native' in your project directory. To silence this warning, pass 'enableNative: false' to Sentry.init().
 ERROR  Error: You attempted to set the key `sdk` with the value `{"name":"sentry.javascript.react-native.expo","packages":[{"name":"npm:sentry-expo","version":"6.2.1"},{"name":"npm:@sentry/react-native","version":"4.15.2"}],"version":"6.2.1"}` on an object that is meant to be immutable and has been frozen., js engine: hermes

Error does not occur when enableNative is set to false.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

48

Environment

expo-env-info 1.0.5 environment info:
System:
OS: macOS 13.0.1
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.16.0 - /usr/local/bin/node
Yarn: 1.22.15 - ~/.yarn/bin/yarn
npm: 8.1.2 - /usr/local/bin/npm
Managers:
CocoaPods: 1.8.4 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.3
System Images: android-29 | Google Play Intel x86 Atom
IDEs:
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
npmPackages:
expo: ^48.0.16 => 48.0.19
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.71.8 => 0.71.8
react-native-web: ~0.18.9 => 0.18.12
npmGlobalPackages:
eas-cli: 3.13.3
expo-cli: 6.3.8
Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

Any build with sentry-expo v6.2.1.

@denisbarriere
Copy link

Facing the same issue. Reverting to @sentry/[email protected] and [email protected] solved the issue, but I now get the following warning when running npx expo start.

Some dependencies are incompatible with the installed expo version:
  @sentry/[email protected] - expected version: 4.15.2
  [email protected] - expected version: ~6.2.0
Your project may not work correctly until you install the correct versions of the packages.
Install individual packages by running npx expo install @sentry/[email protected] sentry-expo@~6.2.0

@pkayfire
Copy link
Author

FWIW, production build runs fine, but it is annoying that my dev build crashes every time I edit App.tsx. Would appreciate a speedy resolution to this issue from the maintainers.

Thanks ahead of time!

@MorenoMdz
Copy link

Hey there, this issue is affecting us directly, our production build works fine but we are waiting to upgrade our Sentry packages and expo sentry to fix one other issues related to Sentry Java that was causing our App to crash on reload, and we do reload the App to apply OTA updates. Basically this is causing our app to be in a state we cant enforce OTA updates until this is fixed. : /

@matous94
Copy link

@MorenoMdz

The problem with reload causing crash is solved in sentry-expo pre-release. https://github.com/expo/sentry-expo/releases/tag/v7.0.0

@MorenoMdz
Copy link

@MorenoMdz

The problem with reload causing crash is solved in sentry-expo pre-release. https://github.com/expo/sentry-expo/releases/tag/v7.0.0

Yes but then we get this error

@matous94
Copy link

@MorenoMdz

Well this error is just an inconvenience while developing, version 7 works well, at least in my case anyway. Hopefully this will be fixed soon though, looking forward to it.

@vKongv
Copy link

vKongv commented Jun 26, 2023

Hi, is this only affecting dev build? I am facing this issue in my [email protected] and @sentry/[email protected]

@MorenoMdz
Copy link

@MorenoMdz

Well this error is just an inconvenience while developing, version 7 works well, at least in my case anyway. Hopefully this will be fixed soon though, looking forward to it.

I am not sure I can agree with that since the app crashing every time we save something is pretty bad.

@matous94
Copy link

@MorenoMdz

Yeah I can imagine, if it's happening to you on every save, that's not my case. Maybe disabling Sentry in DEV would do the trick.

@Kwabena-Agyeman
Copy link

Facing the same issue in my expo dev client, pretty annoying issue

@opeah
Copy link

opeah commented Jul 7, 2023

Facing the same issue with development build

@ahilles107
Copy link

Facing the same issue, it crashes on every change.

@mGallee
Copy link

mGallee commented Jul 10, 2023

Facing the same issue with expo dev client

@TideOPL
Copy link

TideOPL commented Jul 10, 2023

Same problem here.

@rogerrc12
Copy link

Same problem here. Any update on this?

@pkayfire
Copy link
Author

Fix in sentry-expo 7.0.1 is now causing an fastlane error when building for production. See #359.

Thanks for the help

@claudiofus
Copy link

I'm facing the same error after the creation of Expo secret and removing authToken from my app.json. With authToken in my app.json I have a security alert but no error and the build works fine.

Tried with 7.0.1 but doesn't work, same error.

@first-dev
Copy link

Here is a workaround that worked for me

if (__DEV__) {
  if (!global.sentryInit) {
    Sentry.init({
	  ...
    });
    global.sentryInit = true;
  }
} else {
  Sentry.init({
    ...
  });
}

@claudiofus
Copy link

Didn't work in my case, I tried with app.config.js and with a simple app.json, removing authToken from app.json

@nickbuc1
Copy link

Facing the same issue.
expo sdk 48, sentry-expo: 6.2.0, @sentry/react-native: 4.15.2
Any update or any idea on how to fix this?
Thanks!

@shaolinjr
Copy link

Anyone with a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet