Electron start script error - windows

i am running a webpack project and running this script
My package.json looks like this
{
"name": "collab-ui",
"version": "0.0.10",
"author": {
"name": "some-name",
"email": "some-emailId"
},
"main": "electron.js",
"scripts": {
"start": "rimraf debug && npm outdated && webpack --watch",
"http": "rimraf debug && npm outdated && webpack --watch",
"release": "rimraf dist && webpack --bail --progress --profile",
"elecstart": "rimraf debug && webpack && electron .",
"elecrel": "electron-packager . XorChat --all",
},
"devDependencies": {
"#types/jquery": "2.0.41",
"api-ai-javascript": "^2.0.0-beta.21",
"autoprefixer": "~6.7.7",
"awesome-typescript-loader": "~3.1.2",
"browser-sync": "~2.18.8",
"browser-sync-webpack-plugin": "~1.1.4",
"css-loader": "~0.27.3",
"custom-event-polyfill": "~0.3.0",
"electron": "^1.7.9",
"electron-packager": "^9.1.0",
"es6-promise": "~4.1.1",
"extract-text-webpack-plugin": "~2.1.0",
"file-loader": "~0.10.1",
"html-loader": "~0.4.5",
"html-webpack-plugin": "~2.28.0",
"html5-notification": "~3.0.0",
"http-proxy-middleware": "~0.17.4",
"import-glob-loader": "~1.1.0",
"knockout": "~3.4.2",
"live-server": "~1.2.0",
"node-sass": "~4.5.0",
"open-browser-webpack-plugin": "~0.0.5",
"postcss-loader": "~1.3.3",
"qrcode-generator": "~1.3.1",
"resolve-url-loader": "~2.1.0",
"rimraf": "~2.6.1",
"sass-loader": "~6.0.3",
"socket.io-client": "~2.0.3",
"store": "~2.0.12",
"style-loader": "~0.14.1",
"ts-loader": "~2.0.2",
"typescript": "~2.2.1",
"url-loader": "~0.5.8",
"webpack": "~2.2.1",
"webpack-dev-middleware": "~1.10.1",
"webpack-dev-server": "~2.4.2",
"webpack-hot-middleware": "~2.17.1",
"webpack-stream": "~3.2.0",
"webrtc-adapter": "^6.0.2",
"uuid": "^3.1.0"
}
}
My electron.js looks like this
const electron = require('electron');
const { app, BrowserWindow } = electron;
app.commandLine.appendSwitch("ignore-certificate-errors");
app.on('ready', () => {
let win = new BrowserWindow({ width: 800, height: 600 });
win.loadURL(`file://${__dirname}/debug/index.html`);
win.webContents.openDevTools();
})
But after running npm run elecstart, i am getting this error
Any clue,why i am getting this error. i am running on windows 10 64bit, 8 gb ram(FYI), but after running the script the window error box comes as shown in the image and after i close it , the script halts.I am suspecting some JS error to be in there, as it is not able to find some symbol or some configuration is missing. Any help is appreciated.

Related

Yarn Build Error: yarn script exited with code SIGTERM

I get the Element repo from github. I installed the packages and when I run npm start which runs yarn build:module_system && concurrently --kill-others-on-fail --prefix "{time} [{name}]" -n res,element-js "yarn start:res" "yarn start:js" it throughs this error:
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2023-01-14 17:58:11.320 [res] yarn start:res exited with code 1
--> Sending SIGTERM to other processes..
2023-01-14 17:58:11.370 [element-js] yarn start:js exited with code SIGTERM
My package.json file:
{
"name": "element-web",
"version": "1.11.17",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
"type": "git",
"url": "https://github.com/vector-im/element-web"
},
"license": "Apache-2.0",
"files": [
"lib",
"res",
"src",
"webpack.config.js",
"scripts",
"docs",
"release.sh",
"deploy",
"CHANGELOG.md",
"CONTRIBUTING.rst",
"LICENSE",
"README.md",
"AUTHORS.rst",
"package.json",
"contribute.json"
],
"style": "bundle.css",
"scripts": {
"i18n": "matrix-gen-i18n",
"prunei18n": "matrix-prune-i18n",
"diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && matrix-gen-i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
"clean": "rimraf lib webapp",
"build": "yarn clean && yarn build:genfiles && yarn build:bundle",
"build-stats": "yarn clean && yarn build:genfiles && yarn build:bundle-stats",
"build:jitsi": "node scripts/build-jitsi.js",
"build:res": "node scripts/copy-res.js",
"build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
"build:bundle": "webpack --progress --bail --mode production",
"build:bundle-stats": "webpack --progress --bail --mode production --json > webpack-stats.json",
"build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js",
"dist": "scripts/package.sh",
"start": "yarn build:module_system && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
"start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"",
"start:res": "yarn build:jitsi && node scripts/copy-res.js -w",
"start:js": "webpack-dev-server --host=0.0.0.0 --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js -w --mode development --disable-host-check --hot",
"lint": "yarn lint:types && yarn lint:js && yarn lint:style",
"lint:js": "eslint --max-warnings 0 src module_system test && prettier --check .",
"lint:js-fix": "prettier --write . && eslint --fix src module_system test",
"lint:types": "tsc --noEmit --jsx react && tsc --noEmit --project ./tsconfig.module_system.json",
"lint:style": "stylelint \"res/css/**/*.pcss\"",
"test": "jest",
"coverage": "yarn test --coverage",
"analyse:unused-exports": "node ./scripts/analyse_unused_exports.js"
},
"dependencies": {
"#matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/#matrix-org/olm/-/#matrix-org/olm-3.2.12.tgz",
"#matrix-org/react-sdk-module-api": "^0.0.3",
"gfm.css": "^1.1.2",
"jsrsasign": "^10.5.25",
"katex": "^0.16.0",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
"matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop",
"matrix-widget-api": "^1.1.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"sanitize-html": "^2.3.2",
"ua-parser-js": "^1.0.0"
},
"devDependencies": {
"#babel/core": "^7.12.10",
"#babel/eslint-parser": "^7.12.10",
"#babel/eslint-plugin": "^7.12.10",
"#babel/plugin-proposal-class-properties": "^7.12.1",
"#babel/plugin-proposal-export-default-from": "^7.12.1",
"#babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
"#babel/plugin-proposal-numeric-separator": "^7.12.7",
"#babel/plugin-proposal-object-rest-spread": "^7.12.1",
"#babel/plugin-proposal-optional-chaining": "^7.12.7",
"#babel/plugin-syntax-dynamic-import": "^7.8.3",
"#babel/plugin-transform-runtime": "^7.12.10",
"#babel/preset-env": "^7.12.11",
"#babel/preset-react": "^7.12.10",
"#babel/preset-typescript": "^7.12.7",
"#babel/register": "^7.12.10",
"#babel/runtime": "^7.12.5",
"#casualbot/jest-sonar-reporter": "^2.2.5",
"#principalstudio/html-webpack-inject-preload": "^1.2.7",
"#sentry/webpack-plugin": "^1.18.1",
"#svgr/webpack": "^5.5.0",
"#testing-library/react": "^12.1.5",
"#types/flux": "^3.1.9",
"#types/jest": "^29.0.0",
"#types/jsrsasign": "^10.5.4",
"#types/modernizr": "^3.5.3",
"#types/node": "^16",
"#types/react": "17.0.49",
"#types/react-dom": "17.0.17",
"#types/sanitize-html": "^2.3.1",
"#types/ua-parser-js": "^0.7.36",
"#typescript-eslint/eslint-plugin": "^5.6.0",
"#typescript-eslint/parser": "^5.6.0",
"allchange": "^1.0.6",
"babel-jest": "^29.0.0",
"babel-loader": "^8.2.2",
"chokidar": "^3.5.1",
"concurrently": "^7.0.0",
"cpx": "^1.5.0",
"css-loader": "^4",
"dotenv": "^16.0.2",
"eslint": "8.28.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-deprecate": "^0.7.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^0.9.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-unicorn": "^45.0.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"fake-indexeddb": "^4.0.0",
"fetch-mock-jest": "^1.5.1",
"file-loader": "^6.0.0",
"fs-extra": "^11.0.0",
"html-webpack-plugin": "^4.5.2",
"jest": "^29.0.0",
"jest-canvas-mock": "^2.3.0",
"jest-environment-jsdom": "^29.0.0",
"jest-mock": "^29.0.0",
"jest-raw-loader": "^1.0.1",
"json-loader": "^0.5.7",
"loader-utils": "^3.0.0",
"matrix-mock-request": "^2.5.0",
"matrix-web-i18n": "^1.3.0",
"mini-css-extract-plugin": "^1",
"minimist": "^1.2.6",
"mkdirp": "^1.0.4",
"modernizr": "^3.12.0",
"node-fetch": "^2.6.7",
"optimize-css-assets-webpack-plugin": "^6.0.0",
"postcss": "^8.4.16",
"postcss-easings": "^2.0.0",
"postcss-hexrgba": "2.0.1",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-mixins": "^6.2.3",
"postcss-nested": "^4.2.3",
"postcss-preset-env": "^6.7.0",
"postcss-scss": "^4.0.4",
"postcss-simple-vars": "^5.0.2",
"prettier": "2.8.0",
"raw-loader": "^4.0.2",
"rimraf": "^3.0.2",
"semver": "^7.3.7",
"simple-proxy-agent": "^1.1.0",
"string-replace-loader": "3",
"style-loader": "2",
"stylelint": "^14.9.1",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-standard": "^29.0.0",
"stylelint-scss": "^4.2.0",
"terser-webpack-plugin": "^4.0.0",
"ts-prune": "^0.10.3",
"typescript": "4.9.3",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.2",
"worker-loader": "^3.0.0",
"worklet-loader": "^2.0.0",
"yaml": "^2.0.1"
},
"jest": {
"testEnvironment": "jsdom",
"testEnvironmentOptions": {
"url": "http://localhost/"
},
"testMatch": [
"<rootDir>/test/**/*-test.[tj]s?(x)"
],
"setupFiles": [
"jest-canvas-mock"
],
"setupFilesAfterEnv": [
"<rootDir>/node_modules/matrix-react-sdk/test/setupTests.js"
],
"moduleNameMapper": {
"\\.(css|scss|pcss)$": "<rootDir>/__mocks__/cssMock.js",
"\\.(gif|png|ttf|woff2)$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/imageMock.js",
"\\.svg$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/svg.js",
"\\$webapp/i18n/languages.json": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/languages.json",
"^react$": "<rootDir>/node_modules/react",
"^react-dom$": "<rootDir>/node_modules/react-dom",
"^matrix-js-sdk$": "<rootDir>/node_modules/matrix-js-sdk/src",
"^matrix-react-sdk$": "<rootDir>/node_modules/matrix-react-sdk/src",
"decoderWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"decoderWorker\\.min\\.wasm": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"waveWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"context-filter-polyfill": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"FontManager.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/FontManager.js",
"workers/(.+)\\.worker\\.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/workerMock.js",
"^!!raw-loader!.*": "jest-raw-loader",
"RecorderWorklet": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js"
},
"transformIgnorePatterns": [
"/node_modules/(?!matrix-js-sdk).+$",
"/node_modules/(?!matrix-react-sdk).+$"
],
"coverageReporters": [
"text-summary",
"lcov"
],
"testResultsProcessor": "#casualbot/jest-sonar-reporter"
},
"#casualbot/jest-sonar-reporter": {
"outputDirectory": "coverage",
"outputName": "jest-sonar-report.xml",
"relativePaths": true
}
}
Tell me if any other debug detail is needed. Thanks in advance :)

Webpack not found when deploying using heroku

I'm trying to deploy an app on heroku, but I'm getting an error when it tried to build the app with the webpack command. I have tried a number of fixes but can't seem to get it to work. I tried running the webpack.js file from node_modules like this node node_modules/webpack/bin/webpack.js but that didn't work either. Any ideas would be greatly appreciated! Here is my package.json file:
{
"name": "waste-not-client",
"version": "1.0.0",
"description": "",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "concurrently npm:watch:*",
"build": "webpack --mode production",
"watch:compile": "webpack --mode development --watch",
"watch:serve": "nodemon server/server.js",
"heroku-postbuild": "npm install && npm run build && node server/server.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Blue-ocean-HR/blueocean-client.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Blue-ocean-HR/blueocean-client/issues"
},
"homepage": "/",
"dependencies": {
"#auth0/auth0-react": "^1.12.0",
"axios": "^1.1.3",
"compression": "^1.7.4",
"concurrently": "^7.6.0",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"framer-motion": "^7.6.7",
"nodemon": "^2.0.20",
"path": "^0.12.7",
"react": "^18.2.0",
"react-autocomplete-input": "^1.0.19",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.3",
"webpack-bundle-analyzer": "^4.7.0"
},
"devDependencies": {
"#babel/core": "^7.12.3",
"#babel/plugin-syntax-jsx": "^7.18.6",
"#babel/preset-env": "^7.12.1",
"#babel/preset-react": "^7.12.5",
"autoprefixer": "^10.4.13",
"babel-jest": "^29.1.2",
"babel-loader": "^8.2.1",
"compression-webpack-plugin": "^10.0.0",
"css-loader": "^6.7.1",
"dotenv-webpack": "^8.0.1",
"postcss": "^8.4.19",
"postcss-loader": "^7.0.1",
"postcss-preset-env": "^7.8.3",
"style-loader": "^3.3.1",
"tailwindcss": "^3.2.4",
"webpack": "^5.75.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1"
},
"engines": {
"node": "v16.16.0"
}
}
The error when I try to deploy on heroku:
sh: 1: webpack: not found
Your start script looks like it's designed for development work with live reloading. That's not what you want on Heroku.
You could rewrite your package.json scripts, but the easiest solution is probably to add a Procfile that Heroku will use in preference to your start script, e.g.
web: node server/server.js
You'll also want to remove your heroku-postbuild script entirely. It just repeats two things that Heroku does automatically (installing dependencies and running your build), and it also includes the runtime command that we now have in our Procfile.

Issue in path of deployed MERN app on heroku

getting Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
package.json
"name": "google-contacts-backend",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"dev": "nodemon ./bin/www",
"test": "nyc _mocha --timeout 10000 --exit --report lcovonly -- -R spec",
"lint": "eslint --fix --config .eslintrc.json \"**/*.js\"",
"heroku-postbuild": "cd client && npm install --only=dev && npm install && npm run build"
},
"dependencies": {
"axios": "^0.19.2",
"bcrypt": "^3.0.6",
"codacy-coverage": "^3.4.0",
"cookie-parser": "~1.4.3",
"cors": "^2.8.5",
"debug": "~2.6.9",
"dotenv": "^8.2.0",
"express": "~4.16.0",
"express-jwt": "^5.3.1",
"express-validator": "^6.2.0",
"googleapis": "^58.0.0",
"jsonwebtoken": "^8.5.1",
"mocha-lcov-reporter": "^1.3.0",
"moment": "^2.24.0",
"morgan": "~1.9.0",
"nodemailer": "^6.3.1"
},
"devDependencies": {
"chai": "^4.2.0",
"chai-http": "^4.3.0",
"eslint": "^6.5.1",
"mocha": "^6.2.2",
"nodemon": "^1.19.4",
"nyc": "^14.1.1"
}
}```
server.js
```app.get("*", (req, res) => {
res.sendFile(path.join(__dirname, "client", "build", "index.html"));
});
when I tried to check client folder directly in heroku bach, it was empty.

CFBundleIdentifier Collision while uploading a macOS app developed with Electron and built with electron-builder

I am currently developing an Electron app and I am able to generate the .app and .pkg for the macOS operating systems. Although I can run it from the .app generated, when I try to upload the .pkg (mas) I get the following error on AppStore Connect:
CFBundleIdentifier Collision -
The Info.plist CFBundleIdentifier value 'org.phantomjs' of 'phantomjs'
is already in use by another application.
I have tried updating Electron to the latest stable version (2.0.9), and updating electron-builder to the latest version (20.28.4). I've tried searching for the org.phantomjs string in the resulting .app and I am unable to find a Info.plist with that Bundle Identifier
Here I attach my package.json in case it is useful:
{
"name": "myAppName",
"version": "0.0.1",
"author": "Me <me#mymail.com>",
"description": "My Description",
"license": "MIT",
"main": "./dist/electron/main.js",
"repository": {
"type": "git",
"url": "git+https://github.com/****.git"
},
"scripts": {
"build": "node .electron-vue/build.js && electron-builder",
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
"dev": "node .electron-vue/dev-runner.js",
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src",
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
"pack": "npm run pack:main && npm run pack:renderer",
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
"postinstall": "npm run lint:fix"
},
"build": {
"productName": "myAppName",
"appId": "this.is.a.real.appid",
"buildVersion": "5",
"directories": {
"output": "build"
},
"files": [
"dist/electron/**/*"
],
"dmg": {
"contents": [
{
"x": 410,
"y": 150,
"type": "link",
"path": "/Applications"
},
{
"x": 130,
"y": 150,
"type": "file"
}
]
},
"mac": {
"icon": "build/icons/icon.icns",
"category": "public.app-category.developer-tools",
"target": [
{
"target": "mas"
}
]
},
"mas": {
"entitlements": "build/entitlements.mas.plist",
"entitlementsInherit": "build/entitlements.mas.inherit.plist",
"icon": "build/icons/icon.icns",
"category": "public.app-category.developer-tools"
},
"win": {
"icon": "build/icons/icon.ico",
"target": [
{
"target": "nsis"
},
{
"target": "appx"
}
]
},
"linux": {
"icon": "build/icons"
},
"fileAssociations": [
{
"ext": "myExtension",
"name": "My Project",
"description": "File containing a My Project.",
"icon": "build/icons/Project.icns",
"role": "Editor",
"isPackage": true
}
],
"copyright": "Copyright © 2018 Me"
},
"dependencies": {
"#appshuttle.io/bell": "0.0.12",
"#appshuttle.io/pollock": "0.0.28",
"#appshuttle.io/turing": "0.0.16",
"#fortawesome/fontawesome-svg-core": "^1.2.2",
"#fortawesome/free-brands-svg-icons": "^5.0.13",
"#fortawesome/free-regular-svg-icons": "^5.0.13",
"#fortawesome/free-solid-svg-icons": "^5.0.13",
"#fortawesome/vue-fontawesome": "0.1.1",
"axios": "^0.16.1",
"electron-updater": "^3.0.3",
"email-validator": "^2.0.4",
"grunt": "^1.0.3",
"nedb": "^1.8.0",
"p5": "^0.6.1",
"path": "^0.12.7",
"spectre.css": "^0.5.3",
"vue": "^2.3.3",
"vue-color": "^2.4.6",
"vue-electron": "^1.0.6",
"vue-router": "^2.5.3",
"vuedraggable": "^2.16.0",
"vuex": "^2.3.1"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.5",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.24.1",
"babili-webpack-plugin": "^0.1.2",
"cfonts": "^1.2.0",
"chalk": "^2.4.1",
"copy-webpack-plugin": "^4.5.2",
"cross-env": "^5.2.0",
"css-loader": "^0.28.11",
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^2.0.0",
"electron-builder": "20.28.4",
"electron-debug": "^2.0.0",
"electron-devtools-installer": "^2.2.4",
"eslint": "^4.19.1",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-html": "^3.1.1",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"html-webpack-plugin": "^2.30.1",
"mini-css-extract-plugin": "^0.4.1",
"multispinner": "^0.2.1",
"node-loader": "^0.6.0",
"node-sass": "^4.9.2",
"sass-loader": "^6.0.7",
"style-loader": "^0.18.2",
"url-loader": "^0.5.9",
"vue-html-loader": "^1.2.4",
"vue-loader": "^15.4.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.4.2",
"webpack": "^3.12.0",
"webpack-dev-server": "^2.7.1",
"webpack-hot-middleware": "^2.22.3"
}
}
Thanks so much in advance!
Found a solution (As mentioned by #countravioli in this Github Issue):
I found that there was a file called app.asar.unpacked that contained multiple Bundle Identifiers once the .pkg was created and signed. Deleting this file in the .app and then creating a .pkg didn't work for me so I used a Build Hook as proposed in the Github Issue. To prevent the file to being inserted to the .pkg file. To do this, I added a hook to the build section of my package.json at the end of the rest of its contents:
package.json
{ //package.json Root ...
build: {
// build content ...
"afterPack": "./afterPack.js"
}
}
An then created a file called afterPack.js in the folder where my package.json is located with the following contents:
const fs = require('fs');
const fse = require('fs-extra');
const path = require('path');
module.exports = function (params) {
const unpackFile = path.join(params.appOutDir, 'YOUR_APP_NAME.app/Contents/Resources/app.asar.unpacked');
console.log('EXISTS?', fs.existsSync(unpackFile));
console.log("REMOVE", unpackFile);
fse.removeSync(unpackFile);
};
I was able to upload the package to AppStore Connect without any issue.

before all" hook: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves

My package.json id define below and I am using e2e pattern and not define any test file. My test case come under e2e and contain test text so that mocha can read it
{
"name": "appOfCard",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"watch:test": "npm run test -- --watch",
"clean-cache": "watchman watch-del-all",
"svg-transform": "msvgc -f ./src/shared-ui/Icon/svg/$SVG.svg -o ./src/shared-ui/Icon/native/ --react-native",
"#svg_cmd_example": "SVG=search yarn run svg-transform",
"syncmessages": "node syncI18n.js",
"postinstall": "npm run syncmessages",
"rnd": "adb shell input keyevent KEYCODE_MENU",
"runios": "react-native run-ios --simulator='iPhone 7'",
"runandroid": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android",
"precommit": "lint-staged && npm run test && npm run syncmessages",
"lint": "eslint src",
"lint-fix": "eslint --fix src",
"test": "mocha .\\e2e\\*test.js",
"detox-server": "detox-server",
"e2e": "mocha e2e --opts ./e2e/mocha.opts",
"build": "xcodebuild -project NativeExample.xcodeproj -scheme NativeExample -derivedDataPath . -sdk iphonesimulator"
},
"rnpm": {
"assets": [
"./src/assets/fonts"
]
},
"moduleRoots": [
"./src/"
],
"lint-staged": {
"*.js": "eslint --ignore-path .gitignore"
},
"dependencies": {
"base-64": "^0.1.0",
"creditcardutils": "^1.0.0",
"email-validator": "^1.1.1",
"gem": "^2.4.2",
"geolib": "^2.0.24",
"husky": "^0.14.3",
"i18n-iso-countries": "^3.3.0",
"i18n-js": "^3.0.1",
"is-email": "^1.0.0",
"jsbarcode": "^3.8.0",
"lint-staged": "^7.0.0",
"lodash": "^4.17.4",
"lodash.groupby": "^4.6.0",
"moment": "^2.19.1",
"normalizr": "^3.2.4",
"prop-types": "^15.5.10",
"react": "^16.2.0",
"react-native": "0.51.0",
"react-native-acc": "^1.0.0",
"react-native-acc-gcm": "^1.0.0",
"react-native-appsflyer": "1.1.12",
"react-native-barcode-builder": "^1.0.2",
"react-native-camera": "https://github.com/PierreYvesParis/react-native-camera.git#stable",
"react-native-communications": "^2.2.1",
"react-native-device-brightness": "^1.2.0",
"react-native-device-info": "^0.17.4",
"react-native-extended-stylesheet": "^0.6.0",
"react-native-firebase": "^3.2.0",
"react-native-geolocation-service": "^1.0.0",
"react-native-htmlview": "^0.12.1",
"react-native-i18n": "^2.0.6",
"react-native-image-picker": "^0.26.7",
"react-native-image-progress": "^1.0.1",
"react-native-interactable": "^0.1.3",
"react-native-keyboard-aware-scroll-view": "~0.4.3",
"react-native-linear-gradient": "^2.3.0",
"react-native-maps": "~0.20.0",
"react-native-material-textfield": "https://github.com/antoinegrelard/react-native-material-textfield.git#master",
"react-native-modal": "^4.0.0",
"react-native-open-maps": "^0.1.1",
"react-native-open-settings": "^1.0.1",
"react-native-photo-view": "^1.4.0",
"react-native-section-list-get-item-layout": "^2.0.0",
"react-native-shadow": "^1.2.1",
"react-native-shadow-view": "^0.0.1",
"react-native-snap-carousel": "^3.6.0",
"react-native-svg": "^5.5.1",
"react-native-swiper": "^1.5.13",
"react-native-text-input-reset": "^1.0.2",
"react-native-version-check": "^2.0.1",
"react-native-video": "^2.0.0",
"react-navigation": "~1.1.2",
"react-navigation-redux-helpers": "~1.0.1",
"react-navigation-slide-from-right-transition": "^1.0.4",
"react-redux": "^5.0.6",
"react-string-replace": "^0.4.1",
"recompose": "^0.25.0",
"redux": "^3.7.2",
"redux-persist": "^4.10.1",
"redux-thunk": "^2.2.0",
"reselect": "^3.0.1",
"shortid": "^2.2.8",
"sync-spreadsheet": "^1.0.7",
"vanilla-masker": "^1.2.0"
},
"devDependencies": {
"babel-eslint": "8.2.1",
"babel-jest": "21.0.2",
"babel-plugin-module-resolver": "2.7.1",
"babel-preset-react-native": "3.0.2",
"detox": "^7.3.7",
"eslint": "4.16.0",
"eslint-config-airbnb": "15.1.0",
"eslint-config-prettier": "2.9.0",
"eslint-import-resolver-babel-module": "3.0.0",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jsx-a11y": "5.1.1",
"eslint-plugin-prettier": "2.6.0",
"eslint-plugin-react": "7.5.1",
"jest": "21.0.2",
"mocha": "^5.1.1",
"msvgc": "^0.1.1",
"prettier": "1.10.2",
"react-test-renderer": "16.0.0-alpha.12",
"regenerator-runtime": "^0.11.0"
},
"detox": {
"specs": "e2e",
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/debug-iphonesimulator/appOfCard.app",
"build": "xcodebuild -project ios/appOfCard.xcodeproj -scheme appOfCard -configuration debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 8 Plus"
}
}
}
}
My init.js file code
const detox = require('detox');
const config = require('../package.json').detox;
-require('babel-polyfill');
before(async () => {
await detox.init(config);
});
after(async () => {
await detox.cleanup();
});

Resources