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

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

Closed
TonyFTannous-Byd opened this issue Feb 7, 2025 · 4 comments

Comments

@TonyFTannous-Byd
Copy link

TonyFTannous-Byd commented Feb 7, 2025

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 in ios platform (android go well)

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

  1. install the repo
  2. npm install
  3. cd ios && pod install
  4. npm run start:clean
  5. npm run android:local (it work no problem)
  6. npm run ios:local it build successfully but during the launching app, the screen crash with 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)

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

Screenshots and Videos

Image

@cipolleschi
Copy link
Contributor

I just tried with these instructions:

npx @react-native-community/cli init TestMetroConnection --version latest --skip-install
cd TestMetroConnection
yarn install
cd ios
bundle install
bundle exec pod install
cd ..
yarn ios

This:

  • creates a new RN app on 0.77, using the most basic vanilla setup,
  • installs JS dependencies,
  • installs ruby gems
  • installs pods
  • build and run the ios app, while also starting metro.

This works. So the problem is not in React Native, but in one of the tools you are using in your app.

Image

What are you using for development?
I saw Reactatron and a bunch of environment files. They might change the setup. It could also be that one of those tools are not compatible with the Swift AppDelegate, but we do not maintain them, so I can't help you with that.

Can you try to open an issue in the Reactatron repo, instead?

@TonyFTannous-Byd
Copy link
Author

TonyFTannous-Byd commented Feb 7, 2025

@cipolleschi
ok, i opened an issue in Reactotron (infinitered/reactotron#1539)

i know it work if i create a project from scratch. but i have a big application created already in react native 0.76.6, i upgrade it to 0.77.0. i remove AppDelegate.mm, AppDelegate.h and main.m and i replaced it by AppDelegate.swift (ios platform) as mention upgrade helper (https://react-native-community.github.io/upgrade-helper/)
after the upgrade complete android work properly, but ios has this issue
if i remove AppDelegate.swift and restore the objective C files AppDelegate.mm (with integration of RCTAppDependencyProvider) and AppDelegate.h and main.m IOS work again properly

@gurbuzzomer
Copy link

I am having the same problem with "react-native": "0.76.6" I don't fully understand the reason for the error, it sometimes occurs. To solve this, connect to the physical device with a cable and run "npx expo run ios --device " build again and you are at the place where you are installing it on my device.

note: @TonyFTannous-Byd I don't think reactotron is the cause of this error because I can't use it from the app

@TonyFTannous-Byd
Copy link
Author

@gurbuzzomer
I believe my app includes libraries that contain modules written in C++, which prevents me from registering them in Swift as shown in the guide. My app works properly in React Native 0.76.6, but when I upgrade to 0.77—where switching AppDelegate from Objective-C to Swift is an option—I encounter issues. However, if I keep AppDelegate in Objective-C and implement RCTAppDependencyProvider, the app works properly.

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

No branches or pull requests

4 participants