Describe the bug
I'm struggling to import external packages to use with Detox test files. My specific use case is that a testID is linked to a unique key that I need to pull from a firebase database. I've looked through these threads documenting similar issues, but all the solutions that I've tried have not worked for me (the majority of the responses were from 2018/early 2019)
https://github.com/vuejs/vue-cli/issues/1584
https://github.com/facebook/jest/issues/6933
Is there a current consensus on the best way to import modules into a test.spec.js style e2e file so that Detox can use them in tests?
To Reproduce
[x] I have tested this issue on the latest Detox release and it still reproduces
Steps to reproduce:
1. add import database from '#react-native-firebase/database'; to the top of the test file
2. run npx react-native start &
3. run npx detox test -c ./e2e/test.spec.js
Configuration
babel.config.js:
module.exports = {
presets: [
[
'babel-preset-env',
{
targets: {
node: 'current'
}
}
]
]
};
package.json:
{
"name": <omitted>,
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "react-scripts jest",
"lint": "eslint .",
"preinstall": "node scripts/pre-install.js",
"appium": "appium",
"build:android": "scripts/build-android.sh",
"build:ios": "scripts/build-ios.sh",
"test:android": "appium-helper --platform android",
"test:ios": "appium-helper --platform ios",
"test:local-e2e": "OS=both scripts/run-local-tests.sh",
"run-emulator:android": "scripts/run-android-emulator.sh",
"kill-emulator:android": "scripts/kill-android-emulator.sh"
},
"dependencies": {
"#react-native-firebase/app": "^6.0.2",
"#react-native-firebase/auth": "^6.0.2",
"#react-native-firebase/database": "^6.0.2",
"babel-plugin-dynamic-import-node": "^2.3.0",
"detox": "15.1.3",
"geocodio-library-node": "^1.0.0",
"prettier": "^1.19.1",
"react": "16.12.0",
"react-native": "0.61.5",
"react-native-animatable": "^1.3.3",
"react-native-collapsible": "^1.5.1",
"react-native-gesture-handler": "^1.4.1",
"react-native-reanimated": "^1.7.0",
"react-native-screens": "^2.0.0-alpha.27",
"react-native-segmented-control-tab": "^3.4.1",
"react-native-testing-library": "^1.11.1",
"react-navigation": "^4.0.10",
"react-navigation-stack": "1.9.3"
},
"devDependencies": {
"#babel/core": "^7.8.3",
"#babel/runtime": "^7.8.3",
"#react-native-community/eslint-config": "^0.0.6",
"appium": "1.16.0",
"babel-jest": "^25.1.0",
"babel-preset-env": "1.7.0",
"babel-preset-react-native": "4.0.1",
"babel-preset-react-native-stage-0": "1.0.1",
"babel-preset-stage-0": "6.24.1",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.58.0",
"prop-types": "15.7.2",
"react-test-renderer": "16.12.0",
"tape-async": "2.3.0",
"tipsi-appium-helper": "3.3.0",
"webdriverio": "5.18.6"
},
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|react-navigation|#react-navigation|#react-native-firebase.*))"
],
"transform": {
"^.+\\.js$": "babel-jest"
},
"setupFiles": [
"./node_modules/react-native-gesture-handler/jestSetup.js",
"react-native/jest/setup.js",
"./jest/setup.js"
]
},
"detox": {
"configurations": {...},
"test-runner": "jest"
}
}
Device and Verbose Detox Logs
● Test suite failed to run
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
.../node_modules/#react-native-firebase/database/lib/index.js:18
import { isBoolean, isNumber, isString } from '#react-native-firebase/app/lib/common';
^^^^^^
SyntaxError: Cannot use import statement outside a module
> 1 | import database from '#react-native-firebase/database';
Environment (please complete the following information):
- Detox: 15.1.3
- React Native: 0.61.5
- Node: 13.5.0
- Device: Dell XPS 13 2019
- OS: Arch Linux
- Test-runner: Jest+jasmine
Related
I went to redeploy my vue3 website this morning and the build kept failing with this message:
- Building for production...
ERROR Failed to compile with 1 error1:45:13 PM
error in ./src/main.js
Syntax Error: Thread Loader (Worker 0)
Failed to load config "plugin:vue/vue3-essential" to extend from.
Referenced from: /home/runner/work/nonunonu-site/nonunonu-site/package.json
at Array.reduceRight (<anonymous>)
# multi ./src/main.js
ERROR Build failed with errors.
Error: Process completed with exit code 1.
after googling about and trying various fixes I apparently broke my project even more, and now I'm receiving this message when I try to run npm run serve
enter code hereStarting development server...
12% building ... modules 0 active/home/andy/Documents/Websites/nonunonu/node_modules/webpack/lib/Dependency.js:332
throw new Error(
^
Error: module property was removed from Dependency (use compilation.moduleGraph.updateModule(dependency, module) instead)
at ProvidedDependency.set (/home/andy/Documents/Websites/nonunonu/node_modules/webpack/lib/Dependency.js:332:9)
at iterationDependencies (/home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/webpack/lib/Compilation.js:940:21)
at /home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/webpack/lib/Compilation.js:950:8
at /home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/webpack/lib/NormalModuleFactory.js:409:6
at /home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/webpack/lib/NormalModuleFactory.js:155:13
at eval (eval at create (/home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1)
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:178:9
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
at CaseSensitivePathsPlugin.fileExistsWithCase (/home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:95:5)
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:118:10
at CaseSensitivePathsPlugin.getFilenamesInDir (/home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:52:5)
at CaseSensitivePathsPlugin.fileExistsWithCase (/home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:101:8)
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:118:10
at Array.<anonymous> (/home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:72:5)
at Storage.finished (/home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
I'm fairly new to development, so any help or suggestions would be great, at this point I feel like deleting the whole site and starting again. thanks!
here is my package.json
{
"name": "nonunonu",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"animejs": "^3.2.1",
"core-js": "^3.6.5",
"vue": "^3.0.0"
},
"devDependencies": {
"#vue/cli-plugin-babel": "^3.3.0",
"#vue/cli-service": "^3.12.1",
"#vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^8.8.0",
"eslint-plugin-vue": "^7.20.0",
"sass": "^1.32.12",
"sass-loader": "^10",
"webpack": "^5.68.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
I am very new to Vue and I am trying to set up vue-i18n and continue to get console warnings
You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.
My process
$npm install vue-i18n#next
$npm i --save-dev #intlify/vue-i18n-loader#next
I have tried adding different things to my vue.config.js file based on various stack overflow answers including
module.exports = {
chainWebpack: config =>
{
config.module
.rule( 'i18n' )
.resourceQuery( /blockType=i18n/ )
.type( 'javascript/auto' )
.use( 'i18n' )
.loader( '#intlify/vue-i18n-loader' )
}
}
and
const webpack = require('webpack');
module.exports = {
configureWebpack:
{
plugins: [
// Define Bundler Build Feature Flags
new webpack.DefinePlugin( {
__VUE_OPTIONS_API__: false,
__VUE_I18N_FULL_INSTALL__: true,
__VUE_I18N_LEGACY_API__: true,
__VUE_I18N_PROD_DEVTOOLS__: false,
__INTLIFY_PROD_DEVTOOLS__: false
} ),
],
}
};
When I use the 1st example vue.config.js the global values all log to the console with the correct values, but I still get the warning.
The only thing that seems to remove the error is modifying the i18n import.
import { createI18n } from 'vue-i18n/index'
However, this seems wrong because it just bypasses the file that generates the warning.
My question boils down too...
How can I configure vue-i18n to work with my vue3 project that uses
npm run serve
in a way that removes the console warning? or What are the exact steps to configure/use/add vue-i18n in my vue3 project.
package.json
{
"name": "octo-train-client",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"#mdi/font": "^6.4.95",
"axios": "^0.24.0",
"core-js": "^3.6.5",
"dotenv-webpack": "^7.0.3",
"form-data": "^4.0.0",
"primeflex": "^2.0.0",
"primeicons": "^4.1.0",
"primevue": "^3.8.2",
"vue": "^3.0.0",
"vue-axios": "^3.4.0",
"vue-i18n": "^9.0.0-rc.4",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.0-0"
},
"devDependencies": {
"#intlify/vue-i18n-loader": "^4.1.0",
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-eslint": "~4.5.0",
"#vue/cli-plugin-router": "~4.5.0",
"#vue/cli-plugin-vuex": "~4.5.0",
"#vue/cli-service": "~4.5.0",
"#vue/compiler-sfc": "^3.0.0",
"#vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.0.0",
"node-sass": "^4.12.0",
"prettier": "^2.2.1",
"sass-loader": "^8.0.2"
}
}
I faced the same problem, and it seems it is normal IF you are on a dev mode.
https://github.com/intlify/vue-i18n-next/issues/810
You should not see that on a production level
The meaning of this warning message is that you need to specify the flag explicitly in the bundler when you do a production build.
Please refer to the following link for packages provided by vue-i18n for bundlers.
https://vue-i18n.intlify.dev/installation.html#with-a-bundler
One advice to help you out is to use the plugins for each bundler listed in the NOTE section of the above link, and they will configure them properly for you. I recommend that you check them out.
Checkout this issue listed in GitHub forum.
Can't for the life of me figure out why my app suddenly won't start. I keep getting this error:
Unable to resolve module fs from
node_modules\firebase-admin\lib\firebase-namespace.js: fs could not
be found within the project.
If you are sure the module exists, try these steps:
Clear watchman watches: watchman watch-del-all
Delete node_modules and run yarn install
Reset Metro's cache: yarn start --reset-cache
Remove the cache: rm -rf /tmp/metro-*
whenever I run expo start in the root folder. I've even tried expo start -c to reset the cache.
I've also tried removing node_modules and npm installing it back for both the {myapp}/functions/node_modules and {myapp}/node_modules.
I've tried updating firebase-admin and all dependencies.
It's weird because my app was working a couple days ago and this came out of the blue. I've never had to install fs before.
Anyone got any idea what's going on here? It feels like a simple environment fix, but I'm not sure.
My app dependencies if it helps:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest"
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.13.0",
"#react-native-community/masked-view": "0.1.10",
"algoliasearch": "^4.8.3",
"axios": "^0.21.1",
"buffer": "^6.0.3",
"expo": "^41.0.0",
"expo-font": "~9.1.0",
"expo-image-picker": "~10.1.4",
"expo-linear-gradient": "~9.1.0",
"expo-notifications": "~0.11.6",
"expo-status-bar": "~1.0.4",
"expo-web-browser": "~9.1.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-elements": "^3.0.0-alpha.1",
"react-native-gesture-handler": "~1.10.2",
"react-native-keyboard-aware-scroll-view": "^0.9.3",
"react-native-linear-gradient": "^2.5.6",
"react-native-paper": "^4.7.0",
"react-native-reanimated": "^1.13.3",
"react-native-screens": "^2.10.1",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "12.1.0",
"react-native-svg-transformer": "^0.14.3",
"react-native-vector-icons": "^7.1.0",
"react-navigation": "^4.4.3",
"react-navigation-drawer": "^2.6.0",
"react-navigation-header-buttons": "^6.3.1",
"react-navigation-stack": "^2.9.0",
"react-navigation-tabs": "^2.10.1",
"react-redux": "^7.2.2",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"firebase": "8.2.3",
"jest": "^26.6.3",
"jest-expo": "^41.0.0",
"react-test-renderer": "^17.0.2"
},
"private": true,
"jest": {
"preset": "jest-expo",
"transformIgnorePatterns": [
"./node_modules/(?!(react-navigation-header-buttons|react-native|react-native-gesture-handler|#expo)|expo-font|#unimodules|expo-asset|expo-constants|expo-file-system|expo-web-browser|react-navigation|react-navigation-stack|unimodules-permissions-interface|expo-permissions|expo-image-picker|expo-linear-gradient/)"
],
"setupFiles": [
"./node_modules/react-native-gesture-handler/jestSetup.js"
],
"verbose": true,
"updateSnapshot": true
}
}
and .babelrc:
{
"presets": [
"babel-preset-expo"
]
}
and firebase functions dependencies:
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "12"
},
"main": "index.js",
"dependencies": {
"algoliasearch": "^4.8.3",
"axios": "^0.21.0",
"cloudinary": "^1.23.0",
"crypto": "^1.0.1",
"events": "^3.3.0",
"express": "^4.17.1",
"firebase": "^8.7.0",
"firebase-admin": "^9.10.0",
"firebase-functions": "^3.14.1"
},
"devDependencies": {
"firebase-functions-test": "^0.2.0"
},
"private": true
}
firebase-admin is then intialized in my {myapp}/functions/index.js as:
const admin = require("firebase-admin");
admin.initializeApp();
and then used as (for example):
// Called for toggling Tutorial Prompt on ProfileScreen
exports.setTutorialPrompt = functions.https.onRequest(async (req, res) => {
res.set("Access-Control-Allow-Origin", "*");
if (req.method === "OPTIONS") {
// Send response to OPTIONS requests
res.set("Access-Control-Allow-Methods", "GET, POST");
res.set("Access-Control-Allow-Headers", "Content-Type");
res.set("Access-Control-Max-Age", "3600");
res.status(201).send("CORS preflight options set!");
} else {
const db = admin.firestore(); // <--------------------------- here
const { exampleId, ExampletwoId, value, screen } = req.body;
const updatedProfile = {
tutorialPrompt: value,
};
const index = await client.initIndex(ALGOLIA_INDEX_NAME);
index
.partialUpdateObject({
objectID: ExhibitUId,
tutorialPrompt: value,
})
.wait();
db.collection("users").doc(localId).update(updatedProfile);
res.status(201).send(`Successfully toggled tutorialing prompt`);
}
});
I managed to fix it.
It was a random import error within the root app folder. Somehow one of my imports got mixed up, and was trying to call a cloud function instead of a redux-action function.
The wrong import:
import { setTutorialPrompt } from "../../functions/index.js";
The correct import:
import { setTutorialPrompt } from "../../store/actions/user";
Since it was trying to import my functions folder, it gave me the fs error. Similar to what #brentvatne was talking about.
If anyone else runs into this error, I recommend moving your cloud functions folder to your desktop or something, and try running your app without it. That's how I found the right error code.
I found this because I ran into pretty much exactly this same issue.
I discovered that there are (weirdly) two ways you can import firebase-admin into react native projects. I was doing import { firestore } from "firebase-admin" and I needed to be doing import firestore from '#react-native-firebase/firestore'
A pretty easy-to-miss difference, so I thought I’d leave a comment here in case anyone else has this issue.
I am using the Vue cli to create a vue app with Firebase as my backend.
A file within my app initializes the Firebase DB by referring to environment variables that are defined in .env files.
.env
FIREBASE_API_KEY=#################################
FIREBASE_AUTH_DOMAIN=#################################
FIREBASE_DB_URL=https://#################################
FIREBASE_PROJECT_ID=#################################
FIREBASE_STORAGE_BUCKET=#################################
FIREBASE_MESSAGING_SENDER_ID=#################################
AUTH_API=https://#################################
.env.development.local and .env.production.local contain the same data.
Within my app I have a file that looks like this:
credentials.js
export default {
config: {
apiKey: process.env.VUE_APP_FIREBASE_API_KEY,
authDomain: process.env.VUE_APP_FIREBASE_AUTH_DOMAIN,
storageBucket: process.env.VUE_APP_FIREBASE_STORAGE_BUCKET,
databaseURL: process.env.VUE_APP_FIREBASE_DB_URL,
projectId: process.env.VUE_APP_FIREBASE_PROJECT_ID,
messagingSenderId: process.env.VUE_APP_FIREBASE_MESSAGING_SENDER_ID
}
}
When I serve the development version of this app using yarn serve, the database is initialized, so the .env variables are obviously read without a problem. However, when I use yarn build and then serve the resulting files in dist, I get an error on the console:
#firebase/database: FIREBASE FATAL ERROR: Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.initializeApp().
Which is basically telling me that the environment variables are not being read in production mode.
Here is my package.json:
{
"name": "web-app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"#firebase/firestore": "^1.9.3",
"axios": "^0.19.0",
"core-js": "^3.3.2",
"element-ui": "^2.12.0",
"feather-icons": "^4.24.1",
"firebase": "^7.2.3",
"firebase-admin": "^8.9.2",
"firebase-functions": "^3.3.0",
"localforage": "^1.7.3",
"node-ipc": "^9.1.1",
"vue": "^2.6.10",
"vue-feather": "^1.0.0",
"vue-feather-icons": "^5.0.0",
"vue-router": "^3.1.3",
"vue2-animate": "^2.1.3",
"vuedraggable": "^2.23.2",
"vuefire": "^2.2.0",
"vuex": "^3.1.1",
"vuex-persist": "^2.1.1"
},
"devDependencies": {
"#vue/cli-plugin-babel": "^4.0.0",
"#vue/cli-service": "^4.0.0",
"babel-eslint": "^10.0.3",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
Can anyone tell me what might be causing this?
You need to prefix your variables with VUE_APP_ in your .env files.
From https://cli.vuejs.org/guide/mode-and-env.html#environment-variables:
Note that only variables that start with VUE_APP_ will be statically embedded into the client bundle with webpack.DefinePlugin.
I am upgrading from RN 0.55.3 to 0.57.0 (manually).
After running react-native run-ios or react-native run-android I'm now getting the error:
error: bundling failed: Error: While trying to resolve module `react-native-firebase`
I already tried re-running react-native link react-native-firebase (per this post) as well as deleting node_modules and re-running yarn and neither worked.
Full error report:
error: bundling failed: Error: While trying to resolve module `react-native-firebase` from file `MyApp/src/screens/StarterPage.js`, the package `MyApp/node_modules/react-native-firebase/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`MyApp/node_modules/react-native-firebase/dist/index.js`. Indeed, none of these files exist:
* `MyApp/node_modules/react-native-firebase/dist/index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
* `MyApp/node_modules/react-native-firebase/dist/index.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
at ResolutionRequest.resolveDependency (MyApp/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:95:15)
at DependencyGraph.resolveDependency (MyApp/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
at Object.resolve (MyApp/node_modules/metro/src/lib/transformHelpers.js:180:25)
at dependencies.map.result (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
at Array.map (<anonymous>)
at resolveDependencies (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
at MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
at Generator.next (<anonymous>)
at step (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)
at MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:467
BUNDLE [ios, dev] ../../index.js ▓▓▓▓▓▓▓▓▓▓▓░░░░░ 73.4% (796/929)::1 - - [04/Jun/2019:00:27:03 +0000] "GET /index.bundle?platform=ios&dev=true&minify=false HTTP/1.1" 200 - "-" "MyApp/79 CFNetwork/978.0.7 Darwin/18.6.0"
BUNDLE [ios, dev] ../../index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ 92.7% (904/939)
I checked and all these files are in node_modules/react-native-firebase. For instance, /dist/index.js is:
import firebase from './modules/core/firebase';
export default firebase;
export * from './modules/core/firebase';
/*
* Export App types
*/
My package.json
{
"name": "MyApp",
"version": "2.1.27",
"private": true,
"scripts": {
"clean:android": "./android/gradlew -p android/ clean && git clean -dfX -e *.iml android/build android/app/src",
"bundle:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",
"build:android:release": "yarn clean:android && yarn bundle:android && ./android/gradlew -p android/ assembleRelease",
"run:android:release": "react-native run-android --variant=release",
"run:android:debug": "react-native run-android",
"test": "jest",
"android-linux": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android",
"eslint": "eslint —-ext .js ./src/",
"eslint:fix": "eslint --fix ./src/",
"flow": "flow",
"flow-stop": "flow stop",
"postinstall": "sed -i '' \"s/version.startsWith('iOS')/version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS')/g\" ./node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js"
},
"dependencies": {
"#babel/runtime": "^7.4.5",
"#react-native-community/async-storage": "^1.3.3",
"adm-zip": "^0.4.11",
"axios": "^0.18.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"base-64": "^0.1.0",
"d3-format": "^1.3.0",
"hoist-non-react-statics": "^3.0.1",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"moment-timezone": "^0.5.17",
"piexifjs": "^2.0.0-beta.7",
"plist": "^3.0.1",
"prop-types": "^15.6.2",
"react": "16.5.0",
"react-native": "0.57.0",
"react-native-animatable": "^1.3.0",
"react-native-camera": "^1.6.3",
"react-native-carrier-info": "^1.0.1",
"react-native-circular-progress": "git+https://git#github.com/bartgryszko/react-native-circular-progress.git",
"react-native-confetti": "^0.1.0",
"react-native-contacts": "^2.2.3",
"react-native-country-picker-modal": "^0.5.1",
"react-native-datepicker": "^1.7.2",
"react-native-default-preference": "^1.3.1",
"react-native-device-info": "^0.21.5",
"react-native-dotenv": "^0.2.0",
"react-native-extended-stylesheet": "^0.8.1",
"react-native-fbsdk": "^0.8.0",
"react-native-firebase": "5.2.0",
"react-native-fs": "^2.13.3",
"react-native-image-crop-picker": "^0.24.0",
"react-native-keyboard-aware-scrollview": "^2.0.0",
"react-native-localization": "1.0.9",
"react-native-maps": "^0.22.1",
"react-native-mixpanel": "^1.1.1",
"react-native-modalbox": "^1.4.2",
"react-native-permissions": "^1.1.1",
"react-native-popover-tooltip": "^1.1.4",
"react-native-popup-menu": "^0.14.0",
"react-native-share": "^1.1.3",
"react-native-snap-carousel": "^3.7.5",
"react-native-sound": "^0.10.9",
"react-native-svg": "^9.2.4",
"react-native-svg-charts": "^5.2.0",
"react-native-swiper": "^1.5.13",
"react-native-version-number": "^0.3.4",
"react-native-webview-android-file-upload": "git+https://git#github.com/andreipfeiffer/react-native-webview-android-file-upload.git",
"react-navigation": "^1.5.11",
"xcode": "^1.0.0"
},
"devDependencies": {
"babel-jest": "24.7.1",
"babel-preset-react-native": "5.0.2",
"eslint-config-rallycoding": "^3.2.0",
"flow-bin": "^0.67.1",
"jest": "24.7.1",
"metro-react-native-babel-preset": "0.53.1",
"react-test-renderer": "16.5.0"
},
"jest": {
"preset": "react-native"
},
"rnpm": {
"assets": [
"./assets/fonts/"
]
}
}
I expect my app to run in the emulator (iOS) or on my phone (Android).
Have you tried resetting the watchman and Metro Bundler caches?
watchman watch-del-all
react-native start --reset-cache