expo / expo-electron-adapter

This package wraps `electron-webpack` and adds support for Expo web and other universal React packages.
MIT License
29 stars 11 forks source link

[@expo/electron-adapter] [realm] throws error when running #22

Open younes200 opened 2 years ago

younes200 commented 2 years ago

Summary

Hi, I used the template @realm/expo-template-ts with @expo/electron-adapter to run the app with electron runtime, but I'm facing this issue.

Please find reproductible repo here : https://github.com/younes200/expo-electron-realm

app.json

{
  "expo": {
    "name": "MyAwesomeRealmApp",
    "slug": "MyAwesomeRealmApp",
    "version": "1.0.0",
    "assetBundlePatterns": [
      "**/*"
    ],
    "web": {
      "build": {
        "babel": {
          "include": ["realm", "@realm/react"]
        }
      }
    }
  }
}

Environment

expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 12.0.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
      Yarn: 1.22.17 - ~/.yarn/bin/yarn
      npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    IDEs:
      Android Studio: 2021.1 AI-211.7628.21.2111.8193401
      Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
    npmPackages:
      @expo/webpack-config: ~0.16.21 => 0.16.27 
      expo: ^45.0.0 => 45.0.6 
      react: 17.0.2 => 17.0.2 
      react-dom: 17.0.2 => 17.0.2 
      react-native: 0.68.2 => 0.68.2 
      react-native-web: 0.17.7 => 0.17.7 
    npmGlobalPackages:
      eas-cli: 0.54.1
      expo-cli: 6.0.1
    Expo Workflow: bare

Please specify your device/emulator/simulator platform, model and version

electron@6.0.12

Error output

Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at Function.getFileName (webpack-internal:///./node_modules/bindings/bindings.js:178)
    at bindings (webpack-internal:///./node_modules/bindings/bindings.js:82)
    at getRealmConstructor (webpack-internal:///./node_modules/realm/lib/index.js:9)
    at eval (webpack-internal:///./node_modules/realm/lib/index.js:35)
    at Object../node_modules/realm/lib/index.js (renderer.js:5482)
    at __webpack_require__ (renderer.js:791)
    at fn (renderer.js:102)
    at eval (webpack-internal:///./node_modules/@realm/react/dist/index.js:20)
    at Object../node_modules/@realm/react/dist/index.js (renderer.js:1431)
    at __webpack_require__ (renderer.js:791)

Reproducible demo or steps to reproduce from a blank project

yarn expo-electron start