Skip to content

undefined is not an object (evaluating 'window.location.href') #48624

@sandeepmahajan11

Description

@sandeepmahajan11

Description

I am getting app crash on launch for both the platform android and ios, If I run app in debug mode then it works fine and as soon as removed from debug mode app getting crashed.
I am not getting clear log specific to a library or syntext, only gettine below error.

Error - undefined is not an object (evaluating 'window.location.href')

version - "react-native": "0.72.6",

Steps to reproduce

  1. Install the node_module.
  2. Install the pod.
  3. run the app
  4. after installation it is getting crashed before launch.

React Native Version

0.72.6

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.7.1
  CPU: (10) arm64 Apple M2 Pro
  Memory: 635.34 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.12.0
    path: ~/.nvm/versions/node/v20.12.0/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v20.12.0/bin/npm
  Watchman:
    version: 2024.04.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.7.8
    path: /Users/sandeep.mahajan/.rvm/rubies/ruby-2.7.8/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 11.3.7
    wanted: 11.3.7
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.6
    wanted: 0.72.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: false
  newArchEnabled: false

Stacktrace or Logs

ERROR  TypeError: undefined is not an object (evaluating 'window.location.href')
 WARN  Module BiometricModule requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
 WARN  Module RCTBraintreeModule requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
 WARN  Module AppAlternateIcon requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
 WARN  Module RNDataCollector requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
 WARN  Module RNNetPerformComponent requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
 LOG  Running "VfMobileapp" with {"rootTag":1,"initialProps":{}}
 ERROR  Invariant Violation: "VfMobileapp" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

Reproducer

aws-amplify/amplify-js#4708

Screenshots and Videos

Simulator Screenshot - iPhone 13 Pro - 2025-01-12 at 16 55 35

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionIssues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.Type: Unsupported VersionIssues reported to a version of React Native that is no longer supported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions