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

Incompatibility with Expo SDK 44 + EAS Updates #1683

Closed
kennethlynne opened this issue Feb 1, 2022 · 13 comments
Closed

Incompatibility with Expo SDK 44 + EAS Updates #1683

kennethlynne opened this issue Feb 1, 2022 · 13 comments

Comments

@kennethlynne
Copy link
Contributor

Describe the bug

TypeError: null is not an object (evaluating 'Constants.manifest.logUrl')

Steps to reproduce

Use EAS updates instead of legacy updates and Constants.manifest will be null, and Constants.manifest2 will instead be defined

Environment

  • Bugsnag version: "@bugsnag/expo": "7.16.0",

     "expo": "44.0.3",
     "expo-application": "4.0.1",
     "expo-constants": "13.0.1",
     "expo-device": "4.1.0",
     "expo-updates": "0.11.5",
    
@kennethlynne
Copy link
Contributor Author

kennethlynne commented Feb 1, 2022

Some of the relevant usages that needs to be patched:

We patched all usages using patch-package like so as a temporary workaround:

- Constants.manifest.sdkVersion,
+ (Constants.manifest || Constants.manifest2).sdkVersion,

@luke-belton
Copy link

Hi @kennethlynne -bugsnag-js doesn't support EAS updates at this stage. There's some more discussion on this over at #1600 for a bit more info, but I'm going to close this as it doesn't appear to be an issue with something we officially support.

@kennethlynne
Copy link
Contributor Author

kennethlynne commented Feb 2, 2022

You should prioritize it as it is going to be the default way for many teams to build their app. Would hate to move away from bugsnag as we love the product and rely on it for the rest of the infrastructure, but we're not going to let bugsnag hold us back. Luckily able to move forward by just applying the patch mentioned for now

@brentvatne
Copy link

@kennethlynne - EAS Update is still in preview. It's something that we at Expo and the folks at Bugsnag can work on supporting together as it progresses.

@kennethlynne
Copy link
Contributor Author

True, gotcha! 👍

@kennethlynne
Copy link
Contributor Author

Was a bit grumpy from debugging issues related to EAS channels, dev clients and bugsnag for hours when commenting, but I've had my coffee now. Good point, it is still in preview @brentvatne 😂

Related thread: https://forums.expo.dev/t/custom-dev-client-extra-variables-are-undefined/61414/8

@thorbenprimke
Copy link

thorbenprimke commented Feb 4, 2022

@kennethlynne - thanks for raising this issue. I was running into the same issues integrating it.

One question: Did you run into a problem with building a dev-client for device (developmentClient=true, distribution=internal)?

...
› Executing MyNewAppName » Bundle React Native code and images
1458
    the transform cache was reset.
1459
❌  (../../../../Library/Developer/Xcode/DerivedData/MyNewAppName-gsjiiyfvwhxuudezgxrxjjzghalf/Build/Intermediates.noindex/ArchiveIntermediates/MyNewAppName/BuildProductsPath/Debug-iphoneos/main.jsbundle:270034:25)

  270032 |       hexToRgb: {
  270033 |         value: function value(hex) {
> 270034 |           var matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
         |                         ^ Invalid regular expression: Quantifier has nothing to repeat
  270035 | 
  270036 |           if (!matches) {
  270037 |             return [0, 0, 0];
1460
› Generating debug MyNewAppName » MyNewAppName.app.dSYM
...

EAS builds other targets successfully - dev-client for simulator and internal preview (developmentClient=false, distribution=internal).

@kennethlynne
Copy link
Contributor Author

kennethlynne commented Feb 4, 2022

We have not seen anything like that and we're able to build our dev client successfully with bugsnag atm.

Some relevant dependencies and set up confirmed to work for us (since I have no idea what else might be the problem):

    "@bugsnag/expo": "7.16.0",
    "@expo/metro-config": "0.3.8",
    "expo": "44.0.5",
    "expo-application": "4.0.1",
    "expo-community-flipper": "44.0.0",
    "expo-constants": "13.0.1",
    "expo-dev-client": "0.8.3",
    "expo-dev-menu-interface": "0.5.2",
    "expo-updates": "0.11.6",
    "@babel/cli": "7.16.7",
    "@babel/core": "7.16.7",
    "@babel/preset-typescript": "7.16.7",
    "@expo/config": "6.0.6",

babel.config.js

module.exports = function (api) {
  api.cache(true)

  return {
    presets: ['babel-preset-expo'],
    plugins: [
      'transform-inline-environment-variables',
      'react-native-reanimated/plugin',
    ],
  }
}

@thorbenprimke

@thorbenprimke
Copy link

@kennethlynne - thanks for the quick reply and sharing your dependencies. Lemme give this one more try.

@kennethlynne
Copy link
Contributor Author

Please note @thorbenprimke that the patch I initially suggested is partially incorrect. Here is a PR that improves the patch #1686
I won't spend more time on expanding tests before @luke-belton confirms that they will consider getting this change in.

@thorbenprimke
Copy link

I got around to digging into it further. The exception (a similar one here) itself happens because Hermes does not support named groups in regex functions.

The dependency on the ansi-styles library that contains the regex was already in our codebase - dependency of Jest. And Jest is only a dev dependency.

However removing Jest resolved the build issue. I have also verified that just adding Bugsnag (as a dependency) and Jest (as a dev dependency) reproduces the build failure with a fresh Expo project building on EAS.

Maybe I missed something along the way but that's where I got to.

@Christopher2K
Copy link

Christopher2K commented Apr 21, 2022

Hi, I'm posting here as it can help devs who are stuck on this issue.

Thanks a lot @thorbenprimke for your investigation.

A short term solution would be installing this babel plugin babel-plugin-transform-modern-regexp to enable the missing feature for Hermes.

Credits: facebook/hermes#231 (comment)

@thorbenprimke
Copy link

@Christopher2K - thanks for leaving that tip. I'll give it a try.

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

5 participants