Questions tagged [metro-bundler]
Metro is a JavaScript bundler. It takes in an entry file and various options, and gives you back a single JavaScript file that includes all your code and its dependencies.
metro-bundler
425
questions
346
votes
71
answers
316k
views
Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release
react-native run-android command terminates by leaving a message in android simulator. The message is as follows:
Unable to load script.Make sure you are either running a Metro server or that your ...
180
votes
23
answers
191k
views
How to resolve the error on 'react-native start'
I just installed node.js & cli
installed node.js
installed react-native-cli
npm -g react-native-cli
And created a 'new project'.
react-native init new_project
and inside that 'new_project' ...
64
votes
32
answers
134k
views
'No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.'
My React Native application running on a physical device has some problems.
The Metro bundler console gives a warning :
warn No apps connected. Sending "reload" to all React Native apps ...
53
votes
11
answers
98k
views
TypeError: cb.apply is not a function
I'm trying to run an existing React Native project that uses Metro Bundler. My operating system is Ubuntu 20.04 and I've tried to run the app both on a physical Android device and on an Android ...
42
votes
7
answers
30k
views
Metro bundler: Error: EISDIR: illegal operation on a directory, read
When I reload my bundle this exception is uncaught:
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:592:3)
at tryReadSync (fs.js:366:20)
at Object....
35
votes
2
answers
30k
views
How to make Metro (React Native packager) ignore certain directories
Problem:
My project has a @providesModule naming collision when trying to run react-native run-ios from the command line. It is conflicting with autogenerated dir dist/ which is created by another ...
29
votes
4
answers
19k
views
React Native Error Cannot find module 'metro-config/src/defaults/blacklist'
I'm currently working on a project in React Native, yesterday it was working perfectly with no errors, and now all of a sudden I'm getting this error.
error Cannot find module 'metro-config/src/...
27
votes
10
answers
30k
views
react-native start giving Invalid regular expression invalid error
I followed following link to get started with react-native
Getting started with react native
I tried to create native app without expo
so i as per documentation i followed following command
npm ...
27
votes
7
answers
35k
views
Unknown Option error from Babel in React-Native app
I am building a react-native app with typescript in order to learn react native. Once I run the app with expo start and try to run on emulator I get this error:
index.js: [BABEL] ......../index.js: ...
27
votes
1
answer
15k
views
React Native localhost Another debugger is already connected
Not sure if anyone had this problem, since I could not look it up anywhere but I cannot see any logs for react native app because the browser console tells me that "Another debugger is already ...
19
votes
2
answers
10k
views
What does babel do in react native?
I'm trying to figure out the build process for react native and what exactly it is that both the metro bundler and babeljs do. In particular what allows me to use ES5+ syntax. I'm finding some sources ...
17
votes
1
answer
2k
views
Is it already possible to use top-level await in react-native?
Is it already possible to use top-level await in react-native? I saw it's been added to TypeScript 3.8 (I was not using TS, I just tried to see if it would help but no). However in react-native file ...
16
votes
2
answers
12k
views
React Native TypeScript: Unable to resolve module (but it exists)
I have a fresh React Native 0.61.1 project with TypeScript. It used to display the new project welcome screen perfectly. I've added a class, tried to import it (it even autocompleted), but it says the ...
16
votes
2
answers
14k
views
React native debugger: "Error: ENOENT: no such file or directory"
Problem: When I run the remote debugger, metro server says it can't find this file.
Error: ENOENT: no such file or directory, open '/home/hery/Workspace/NyTiona/http:/localhost:8081/index.bundle?...
14
votes
9
answers
22k
views
“launchPackager.command” can’t be opened
Just updated my Mac to the official release of Ventura, and I cannot launch my application via react-native run-ios.
Expected behavior:
running react-native run-ios will launch an Xcode simulator and ...
13
votes
7
answers
27k
views
"Error: Cannot find module 'metro-core'" when starting an Expo project
Whenever I start Expo Go with the expo start command, this error appears :
Error: Cannot find module 'metro-core'
Require stack:
- /usr/local/lib/node_modules/expo/node_modules/@expo/cli/build/src/...
13
votes
2
answers
6k
views
React Native run error: XXX could not be cloned
I don't know how to better describe it. I was working on react-native project, something happened and I can't run it anymore for some reason. I'm getting weird messages like some function could not be ...
13
votes
2
answers
8k
views
Network Security Config results in React Native app not connecting to metro server
I have a very weird issue that I am not able to solve. I am not sure how to Google this either because while I am familiar with React Native, I am not familiar with Android itself and not sure what my ...
12
votes
5
answers
15k
views
import file dynamically by variable - react native
I have a path.json file that contains the path of a component
// path.json
{
"main": "./login/index.js",
"paths": [
{
"name": "login",
"path": "./login/index.js",
"image": "...
12
votes
1
answer
2k
views
What are the asset download mechanics of Expo and React-Native during development and production mode?
I am confused about the mechanics of Expo and React-Native, how they download the assets.
The info that I know is, once you build your code, expo prepares a bundle which contains both the javascript (...
12
votes
2
answers
3k
views
React Native Stack Traces that point to original files
When I have an error in my React Native app, the stack trace that is printed to the console points to index.bundle instead of the original source code (see example below). Is there a way to configure ...
10
votes
6
answers
8k
views
Metro Builder: SyntaxError: Unexpected token = after upgrading to React Native 0.65.1
Today I updated to React Native Version 0.65.1.
After that I was unable to Start the Metro Server
I am now receiving following error message while building a Release .apk:
node_modules/metro/src/...
10
votes
6
answers
29k
views
react native Cannot find module 'metro/src/reactNative Transformer'
When upgrading to RN 0.59.4 and after a successful build - one can encounter the following error in metro bundler:
react native Cannot find module 'metro/src/reactNative Transformer
10
votes
3
answers
5k
views
Metro bundler with Expo dockerized app is not working
I'm trying to dockerize an Expo React Native app so anyone of my team partners could download the repo and then make a docker-compose up and without effort have the same expo server running in their ...
10
votes
4
answers
14k
views
Unable to load script. Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release
I created a new project with react-native init .
I am using react-native with the following:"react": "16.13.1","react-native": "0.63.2".
When i am trying to run ...
10
votes
2
answers
4k
views
React Native: xcode build success on device but doesn't connect to metro builder
React Native 0.61
I'm trying to figure out where I broke something in XCode or in my iPhone. A couple of days ago everything worked fine - I pressed Run -> Build was successful -> and everything ...
9
votes
5
answers
17k
views
How to fix Metro Bundler process exited with code 1
How to fix Metro Bundler process exited with code 1
Metro 'Bundler' process exited with code 1
Error: Metro 'Bundler' process exited with code 1
at 'ChildProcess' .<anonymous> (C:\@expo\...
9
votes
7
answers
19k
views
React Native iOS simulator "Connect to Metro to Develop Javascript"
I'm running a react native app and constantly running into the issue of the app not connecting to the code to do automatic updates.
Things I've tried:
Reloading main.jsbundle via the following ...
9
votes
3
answers
18k
views
How to append extension in metro.config.js for Metro Bundler?
I'm trying to bundle markdown files without creating much overhead (i.e. not adding them manually to the asset bundles in Xcode and Android Studio, not using 3rd party dependencies).
My idea was to ...
9
votes
1
answer
6k
views
expo sdk 40 metro.config.js "Expected 'fromDir' to be 'string', got 'undefined' "
I’m on a monorepo with yarn workspace and I’m also using react-native-svg-transformer.
I have updated the sdk to the sdk 40 and I have this error in the metro.config.js :
and there is my metro.config....
9
votes
1
answer
11k
views
How to specify Metro Bundler IP adress in my React-Native dev-environment?
Not sure if this is even possible, but here goes:
Setup
I have a React-Native app setup using react-native cli
I'm trying to make network requests to my application backend
say, stage.foo.com/...
9
votes
0
answers
4k
views
How can I symbolicate a call stack in react-native (expo, metro, storybook)
ios simulator screenshot - console warning
When running my react-native application on the iOS Simulator, in the Console Warning, I cannot view the source as the message says:
This call stack is not ...
8
votes
3
answers
11k
views
How can i solve: "RCTBridge required dispatch_sync to load" in React Native using yarn workspaces?
i follow the medium article: React Native 0.63 Monorepo walkthrough carefully to get yarn workspaces works with react-native. Everhtings works, i can build my iOS und Android App and also the Metro ...
8
votes
2
answers
9k
views
Metro-Bundler doesn't automatically open
I'm new to react native and just started with the installations and set up; when I reach to the expo start or npm start] command, in most videos it shows that a page automatically opens on browser ...
8
votes
1
answer
4k
views
METRO BUNDLER ERROR: Metro Has Encountered an error: Cannot read properties of undefined(reading 'transformfile')
I'm not sure why it is showing up like this, The problem occured on Bundler.js, and the error pointed to this line.
TransformFile(filePath, transformOptions) {
var _this3 = this;
return ...
8
votes
1
answer
4k
views
Error: Unable to resolve module stream from C:\**\node_modules\cipher-base\index.js: stream could not be found within the project
The following error showed in my metro bundler when I run react-native with npm plugin @woocommerce/api library. It's currently active plugin for woocommerce rest api.
I've searched many solutions ...
7
votes
3
answers
8k
views
Configure multiple transformers/resolvers using metro
I'm trying to add multiple resolvers and transformers using metro for my react native project, how do I combine them in my metro.config.js file?
Background: I want to get both a sass transformer to ...
7
votes
2
answers
7k
views
Running multiple react-native apps in different ports
How to run multiple instances of metro bundler or react-native apps in a single machine ? The default port that the react-native app runs on is 8081.
7
votes
3
answers
8k
views
Bundler does not load automatically (No bundle URL present error)
After updating my React Native app to the latest version up to date (0.60.4), launching my app using react-native run-ios would result in my application starting without a Metro Bundler.
The ...
7
votes
5
answers
8k
views
Transformer is not a constructor error while updating react native sdk version from 0.61.5 to 0.64.0
I am getting Transformer is not a constructor error after upgrading my react native version to latest.
My metro-react-native-babel-preset version is 0.64.0
Please help me with a solution
7
votes
3
answers
3k
views
White screen after downloading app from TestFlight - Expo
I am facing a weird issue in one of my apps where when I build the app using
expo build:ios
and then upload the app using
Transporter
When I download the app from TestFlight it opens up with a ...
7
votes
1
answer
4k
views
How to run Metro Bundler in VS Code integrated terminal instead of running a new window?
I am running npx scripts to build in VS Code integrated terminal, but Metro Bundler runs in new cmd/bash terminal. How to run it in VS Code integrated terminal?
7
votes
0
answers
902
views
Where do Metro bundler store the generated Bundle?
Whenever we try to build RN app on XCode, a new instance of Metro Bundler will be running, I'm wondering where is the bundleJs being stored.
Reason for asking is, I'm wondering if the below command ...
6
votes
1
answer
16k
views
"npx react-native start" hangs
Introduction
I'm attempting to create a Hello World style program with React Native 0.63.3 using the official docs. I'm using to the React Native CLI Quickstart path in that link.
What I've Done So ...
6
votes
2
answers
9k
views
react-native APK crash with "Unknown" error
My react-native developing environment is on Windows 7; worked fine until yesterday, but suddenly the APK reports an error after it loads the bundle.
The error Message:
Unknown
run
NativeRunnable....
6
votes
1
answer
2k
views
How to use react native's platform-specific extensions with typescript?
The problem:
I have a react native custom hook with platform specific code, which I need to import based on the platform. If I import it like import useWifi from 'hooks/use-wifi.android';, everything ...
6
votes
1
answer
2k
views
How to import external typescript files in expo project
Is there a way to transpile and support imports from a folder that is outside the expo project's main folder?
I'm looking to just import some additional files from a shared folder.
Here's my setup, ...
6
votes
0
answers
131
views
AES.decrypt not working after upgrading react-native
After updating our react native from 0.63.3 to 0.66,
CryptoJS.AES.decrypt(encryptedString, key)
is returning invalid data. We are able to isolate that this is related to metro + babel dependencies ...
6
votes
1
answer
13k
views
TypeError: undefined is not a function, js engine: hermes
My React Native (0.66.3) app today pops up an error with a stable code which hasn't had any change for quite some time. It is on macOS Big Sur. Here is the error:
ERROR TypeError: undefined is not a ...
5
votes
4
answers
10k
views
React-native Fast Refresh broken
recently my Fast Refresh stopped working across ALL of my react native projects, I have even tried init-ing a new project and it is not working there too
I have tried all the attempts below:
-. ...