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

Can't build react native with sentry xcode 12. syntax error. #1245

Closed
6 of 11 tasks
KevinColemanInc opened this issue Dec 15, 2020 · 4 comments
Closed
6 of 11 tasks

Can't build react native with sentry xcode 12. syntax error. #1245

KevinColemanInc opened this issue Dec 15, 2020 · 4 comments

Comments

@KevinColemanInc
Copy link

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: "@sentry/react-native@^1.9.0"

react-native version: 0.63.4

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: 'https://[email protected]/...'
  // other options
});

or

(react-native-sentry)

Sentry.config(
  'https://[email protected]/...'
  // other options
 ).install();

I have following issue:

Can't build react native with sentry xcode 12. syntax error.

Steps to reproduce:
Try to build the app in Xcode to deploy to a physical device.

Someone else thinks its related to xcode 12 (I also run xcode 12).

https://stackoverflow.com/questions/63982355/xcode-12-unable-to-build-in-release-mode-using-sentry-io

Actual result:

/Users/kevin/projects/native/node_modules/@sentry/cli/js/index.js:37
    this.releases = new Releases({ ...this.options, configFile });
                                   ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/kevin/projects/native/node_modules/@sentry/cli/bin/sentry-cli:7:13)
Command /bin/sh failed with exit code 1

Expected result:

No error

@jennmueng
Copy link
Member

This shouldn't be related to Xcode 12, looks like your bundling step is using an older version of node that doesn't support ES6 syntax. Try updating your node version, I recommend trying out nvm.

@KevinColemanInc
Copy link
Author

I have no idea what fixed it. I was using nvm.

@xcarpentier
Copy link

I have this same issue can't find a way to fix it.

@straandr
Copy link

I'm also experiencing this issue, using Node 12.6.0, Yarn 1.22.10, "@sentry/react-native" 2.1.0, sentry-cli 1.63.1.

I had previously installed "@sentry/cli" globally, in case that matters.

The shell script in the project file is as follows:

shellScript = "export SENTRY_PROPERTIES=sentry.properties\nexport SENTRY_LOG_LEVEL=debug\nexport EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\ncd $PROJECT_DIR\nexport NODE_BINARY=node\n../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh\n";

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

No branches or pull requests

4 participants