Skip to content

No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle. #49173

Closed

Description

@TonyFTannous-Byd

Description

i upgrade my react native app from 0.76.6 to 0.77.0. The build has successfully but i have the following error

No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle.

unsanitizedScriptURLString = (null)

Steps to reproduce

i applied all the step mention
https://react-native-community.github.io/upgrade-helper/?from=0.76.6&to=0.77.0&package=com.idp.com&name=IDPMobile

  • npm install
  • cd ios
  • pod deintegrate pod install --repo-update
  • cd ios && xcodebuild clean
  • npx react-native run-ios

React Native Version

0.77.0

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1
  Memory: 111.05 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.1
    path: ~/.nvm/versions/node/v20.18.1/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.2
    path: ~/Documents/AccuV-Team/IDP.Mobile/node_modules/.bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "31"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.2
      - 33.0.3
      - 34.0.0
      - 35.0.0
    System Images:
      - android-31 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
      - android-35 | Google APIs ARM 64 v8a
      - android-35 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12700392
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.0
    wanted: ^0.77.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle.

unsanitizedScriptURLString = (null)

Reproducer

https://github.com/TonyFTannous-Byd/repo

open the terminal and run the following:

1- npm run start:clean
2- npm run android:local (it work no problem)
3- npm run ios:local (ios platform did not work, and i have the error in the Screenshots bellow)
...

Screenshots and Videos

Image

Activity

  1. react-native-bot commented on Feb 4, 2025

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

  2. princektripathi commented on Feb 6, 2025

    @princektripathi
    Collaborator

    @TonyFTannous-Byd, can you please share a repro to validate the issue?

  3. TonyFTannous-Byd commented on Feb 6, 2025

    @TonyFTannous-Byd
    Author

    @princektripathi

    https://github.com/TonyFTannous-Byd/repo

    open the terminal and run the following:

    1- npm run start:clean
    2- npm run android:local (it work no problem)
    3- npm run ios:local (ios platform did not work, and i have the error in the Screenshots bellow)

    Screenshots

    Image

  4. OTitaev commented on Feb 7, 2025

    @OTitaev

    Facing same problem

  5. TonyFTannous-Byd commented on Feb 7, 2025

    @TonyFTannous-Byd
    Author
  6. jeroenburgers commented on Feb 11, 2025

    @jeroenburgers

    It's the same issue for me after updating to the Swift and project.pbxproj file (documented in the update guide diff). I have no idea why.

  7. YlmRdm commented on Feb 14, 2025

    @YlmRdm

    I have also same problem.

  8. OTitaev commented on Feb 14, 2025

    @OTitaev

    Guys, the problem is in DEBUG flag in AppDelegate.swift

    override func bundleURL() -> URL? {
    #if DEBUG
        RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
    #else
        Bundle.main.url(forResource: "main", withExtension: "jsbundle")
    #endif
      }
    
    

    You should add
    SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";

    Inside project.pbxproj in debug XCBuildConfiguration block

    Should look like this

    83CBBA201A601CBA00E9B192 /* Debug */ = {
    			isa = XCBuildConfiguration;
    			buildSettings = {
    				ALWAYS_SEARCH_USER_PATHS = NO;
    				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
    				CLANG_CXX_LANGUAGE_STANDARD = "c++20";
    				CLANG_CXX_LIBRARY = "libc++";
    				CLANG_ENABLE_MODULES = YES;
    				CLANG_ENABLE_OBJC_ARC = YES;
    				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
    				CLANG_WARN_BOOL_CONVERSION = YES;
    				CLANG_WARN_COMMA = YES;
    				CLANG_WARN_CONSTANT_CONVERSION = YES;
    				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
    				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
    				CLANG_WARN_EMPTY_BODY = YES;
    				CLANG_WARN_ENUM_CONVERSION = YES;
    				CLANG_WARN_INFINITE_RECURSION = YES;
    				CLANG_WARN_INT_CONVERSION = YES;
    				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
    				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
    				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
    				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
    				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
    				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
    				CLANG_WARN_STRICT_PROTOTYPES = YES;
    				CLANG_WARN_SUSPICIOUS_MOVE = YES;
    				CLANG_WARN_UNREACHABLE_CODE = YES;
    				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
    				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
    				COPY_PHASE_STRIP = NO;
    				ENABLE_STRICT_OBJC_MSGSEND = YES;
    				ENABLE_TESTABILITY = YES;
    				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
    				GCC_C_LANGUAGE_STANDARD = gnu99;
    				GCC_DYNAMIC_NO_PIC = NO;
    				GCC_NO_COMMON_BLOCKS = YES;
    				GCC_OPTIMIZATION_LEVEL = 0;
    				GCC_PREPROCESSOR_DEFINITIONS = (
    					"DEBUG=1",
    					"$(inherited)",
    				);
    				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
    				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
    				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
    				GCC_WARN_UNDECLARED_SELECTOR = YES;
    				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
    				GCC_WARN_UNUSED_FUNCTION = YES;
    				GCC_WARN_UNUSED_VARIABLE = YES;
    				IPHONEOS_DEPLOYMENT_TARGET = 15.1;
    				LD_RUNPATH_SEARCH_PATHS = (
    					/usr/lib/swift,
    					"$(inherited)",
    				);
    				LIBRARY_SEARCH_PATHS = (
    					"\"$(SDKROOT)/usr/lib/swift\"",
    					"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
    					"\"$(inherited)\"",
    				);
    				MTL_ENABLE_DEBUG_INFO = YES;
    				ONLY_ACTIVE_ARCH = YES;
    				OTHER_CPLUSPLUSFLAGS = (
    					"$(OTHER_CFLAGS)",
    					"-DFOLLY_NO_CONFIG",
    					"-DFOLLY_MOBILE=1",
    					"-DFOLLY_USE_LIBCPP=1",
    					"-DFOLLY_CFG_NO_COROUTINES=1",
    					"-DFOLLY_HAVE_CLOCK_GETTIME=1",
    				);
    				OTHER_LDFLAGS = (
    					"$(inherited)",
    					" ",
    				);
    				REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
    				SDKROOT = iphoneos;
    				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
    				USE_HERMES = true;
    			};
    			name = Debug;
    		};
    
  9. 23 remaining items

  10. genesisbell commented on Jul 24, 2025

    @genesisbell

    My problem was that I had scheme names other than DEBUG. What I needed to do was to Add -DDEBUG to all my Debug-Like Schemes. Steps:

    1. Open Xcode → Project Navigator → Select your app target

    2. Go to Build Settings

    • Filter by: Other Swift Flags
    • Or navigate to:
      Swift Compiler – Custom Flags > Other Swift Flags
    1. Add -DDEBUG to all relevant configurations
      For example:
    Configuration Flags
    devDebug -DDEBUG ✅
    prodDebug -DDEBUG ✅
    stagDebug -DDEBUG ✅
    devRelease (leave empty) ❌
    prodRelease (leave empty) ❌
    stagRelease (leave empty) ❌

    You only need -DDEBUG for the debug builds — never add it to Release.

    ✅ After Adding:

    1. Product > Clean Build Folder
    2. Restart Metro:
      npx react-native start --reset-cache
  11. sandy-garrido commented on Aug 27, 2025

    @sandy-garrido

    For me the issue was simply that the testing device and the developer mac were on restricted networks (the need to be able to talk to each other via the network). I set up a hotspot for both devices (Dev Mac & test iPhone) and now it works.

  12. Super1Windcloud commented on Sep 14, 2025

    @Super1Windcloud

    It's so easy ,
    First method , xcode config Allow access to the local network
    Second method , iphone open settings to set app permission for allow access to local network

  13. ShadyElsharnoby commented on Sep 15, 2025

    @ShadyElsharnoby
  14. ShadyElsharnoby commented on Sep 15, 2025

    @ShadyElsharnoby

    Steps to Reproduce
    upgrade react native to latest 0.81.4
    and add new scripts like Sentry DOC

    `set -e
    WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
    REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
    SENTRY_XCODE="../node_modules/@sentry/react-native/scripts/sentry-xcode.sh"
    BUNDLE_REACT_NATIVE="/bin/sh $SENTRY_XCODE $REACT_NATIVE_XCODE"

    Expected Result
    when run on real device this should work normal like simulator but i faced this error

    No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle. unsanitizedScriptURLString = (null)

    in case i revert the script every thing work good without sentry

    Actual Result
    No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle. unsanitizedScriptURLString = (null)

  15. antinucleus commented on Sep 17, 2025

    @antinucleus

    If a local server (e.g., Express or Fastify) is started on the same port as Expo (8081), this error will occur. In my case, the issue was resolved by stopping the local server or configuring it to use a different port.

  16. Donybro commented on Sep 24, 2025

    @Donybro

    I did prev steps SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; then deleted ios,android,expo, node-modules folders then do npm install, npx expo prebuild --clean and npx expo run:ios --device but still see issue, then I changed my backend base url in .env file from http://localhost:8080 to http://172.16.13.4:8080 (you can get your own with ipconfig getifaddr en0) and it is worked for me

  17. UlasRenasOrdu commented on Oct 15, 2025

    @UlasRenasOrdu

    npm install --> npx expo run:ios

    worked for me.

  18. justsomeofl commented on Jan 25, 2026

    @justsomeofl

    Add this to AppDelegate.swift before startReactNative

        #if DEBUG
          RCTBundleURLProvider.sharedSettings().jsLocation = "192.168.1.20:8081" // IP of your computer
        #endif
    
    
  19. ericTrayt commented on Apr 15, 2026

    @ericTrayt

    Why is this closed, still seems to be an issue for many people and none of the above answers have worked for me.

  20. joartola commented on Apr 21, 2026

    @joartola

    Hitting this on RN 0.83.4 + New Architecture + Expo 55 + Objective-C AppDelegate. Both simulator and physical device affected.

    Diagnosis

    Added logging inside bundleURL to trace the resolution chain:

    - (NSURL *)bundleURL {
    #if DEBUG
      BOOL isRunning = [RCTBundleURLProvider isPackagerRunning:@"localhost"];
      NSString *hostPort = [[RCTBundleURLProvider sharedSettings] packagerServerHostPort];
      NSURL *url = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
      NSLog(@"isPackagerRunning=%@ hostPort='%@' url=%@",
            isRunning ? @"YES" : @"NO", hostPort ?: @"nil", url ?: @"nil");
      return url;
    #else
      ...
    #endif
    }

    Result:

    isPackagerRunning=YES hostPort='nil' url=nil
    

    Metro is reachable at localhost:8081 (200 OK), isPackagerRunning(localhost) returns YES, but packagerServerHostPort returns nil. This means guessPackagerHost inside packagerServerHostPort returns nil despite its individual pieces working correctly.

    After calling setJsLocation:@"localhost" explicitly, packagerServerHostPort returns "localhost" and bundleURL returns a valid URL.

    Workaround

    Two things were needed together:

    1. Add SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG" to the app target's Debug build config (as @TonyFTannous-Byd suggested — it was set project-level but missing on the target itself)

    2. Pre-set jsLocation before startReactNative in AppDelegate:

    #if DEBUG
    {
      NSString *ipPath = [[NSBundle mainBundle] pathForResource:@"ip" ofType:@"txt"];
      NSString *ip = [[NSString stringWithContentsOfFile:ipPath encoding:NSUTF8StringEncoding error:nil]
                      stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
      // Use ip.txt LAN IP for device builds, localhost for simulator/cloud-built dev clients
      BOOL isLanIp = [ip hasPrefix:@"192.168."] || [ip hasPrefix:@"10."];
      NSString *host = (ip.length > 0 && isLanIp) ? ip : @"localhost";
      [[RCTBundleURLProvider sharedSettings] setJsLocation:host];
    }
    #endif

    For us, the SWIFT flag alone wasn't sufficient — possibly because we have an Objective-C AppDelegate (not Swift). The setJsLocation bypass ensures packagerServerHostPort takes the jsLocation path and never hits the broken guessPackagerHost branch.

    Also required for physical devices: runOnlyForDeploymentPostprocessing = 0 on the "Bundle React Native code and images" build phase so ip.txt is generated in Debug builds (was set to 1, meaning it only ran during Archive).

    Environment

    • RN 0.83.4
    • Expo SDK 55
    • New Architecture enabled (RCT_NEW_ARCH_ENABLED=1)
    • Objective-C AppDelegate (inherited from older RN versions)
    • Xcode 16+
  21. wubaibin commented on Sep 9, 2026

    @wubaibin

    First, run "yarn start", and then run "yarn ios".

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

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.📦Bundler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions