CI/CD for NextJs applications fails in Github Actions - node.js

this is my first question here :D
I'm setting up the CI/CD process for a NextJS application and everything is working fine locally but when I try to run the workflow in Github Actions the command npm run build fails. It says that it can't find the babel-plugin-styled-components package, but the package is there.
package.json
{
"name": "some-name",
"version": "0.1.1",
"private": true,
"scripts": {
"dev": "next dev -p 15002",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
"babel-plugin-transform-runtime": "6.23.0",
"dyte-client": "^0.34.0",
"express": "^4.17.1",
"jspdf": "^2.5.1",
"leaflet": "^1.7.1",
"next": "^11.1.2",
"nprogress": "^0.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-fade-in": "^2.0.1",
"react-leaflet": "^3.2.2",
"react-leaflet-enhanced-marker": "^1.0.21",
"react-reveal": "^1.2.2",
"react-simple-maps": "^2.3.0",
"react-slick": "^0.28.1",
"react-truncate": "^2.4.0",
"reactn": "^2.2.7",
"sass": "^1.44.0",
"sharp": "^0.29.3",
"sitemap": "^7.0.0",
"slick-carousel": "^1.8.1",
"timezones-list": "^3.0.1"
},
"dependenciesLocal": {
"babel-plugin-transform-runtime": "6.23.0",
"dyte-client": "^0.34.0",
"express": "^4.17.1",
"leaflet": "^1.7.1",
"next": "^11.1.2",
"nprogress": "^0.2.0",
"react-fade-in": "^2.0.1",
"react-leaflet": "^3.2.2",
"react-leaflet-enhanced-marker": "^1.0.21",
"react-reveal": "^1.2.2",
"react-slick": "^0.28.1",
"react-truncate": "^2.4.0",
"reactn": "^2.2.7",
"sass": "^1.44.0",
"sitemap": "^7.0.0",
"slick-carousel": "^1.8.1"
},
"devDependencies": {
"#typescript-eslint/eslint-plugin": "^4.23.0",
"#typescript-eslint/parser": "^4.23.0",
"babel-eslint": "^10.1.0",
"babel-plugin-styled-components": "^1.12.0",
"delegates": "^1.0.0",
"eslint": "^7.26.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.7.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"typescript": "^4.2.4",
"webpack": "^5.57.1"
},
"engines": {
"node": "14.x"
}
}
deploy.yml
name: Staging deployment
on:
push:
branches:
- "staging"
permissions:
id-token: write
contents: read
env:
SOME_ENV_VARS: SOME_VALUE
jobs:
build:
name: CI Pipeline
runs-on: ubuntu-latest
environment: staging
strategy:
matrix:
node-version: ["14.x"]
steps:
- name: Checkout the files
uses: actions/checkout#v2
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node#v2
with:
node-version: ${{ matrix.node-version }}
# Install project dependencies, test and build
- name: Install dependencies
run: npm install
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Run build
run: npm run build
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
CI: false
deploy:
name: CD Pipeline
runs-on: ubuntu-latest
environment: staging
needs: [build]
strategy:
matrix:
node-version: ["14.x"]
appname: ["main_app"]
deploy-group: ["main_app_staging"]
s3-bucket: ["main-app-codedeploy-staging"]
s3-filename: ["main-app-codedeploy-staging-${{ github.sha }}"]
steps:
- name: Setup repository
uses: actions/checkout#v2
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node#v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Run build
run: npm run build
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
CI: false
# Configure AWS credentials
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials#v1
with:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: OIDCSession
aws-region: ${{ secrets.AWS_REGION }}
# Deploy push to AWS S3
- name: AWS Deploy push
run: |
aws deploy push \
--application-name ${{ matrix.appname }} \
--description "This is a revision for the ${{ matrix.appname }}-${{ github.sha }}" \
--ignore-hidden-files \
--s3-location s3://${{ matrix.s3-bucket }}/${{ matrix.s3-filename }}.zip \
--source .
# Create deployment to CodeDeploy
- name: AWS Create Deployment
run: |
aws deploy create-deployment \
--application-name ${{ matrix.appname }} \
--deployment-config-name CodeDeployDefault.OneAtATime \
--deployment-group-name ${{ matrix.deploy-group }} \
--file-exists-behavior OVERWRITE \
--s3-location bucket=${{ matrix.s3-bucket }},key=${{ matrix.s3-filename }}.zip,bundleType=zip \
The error
./node_modules/next/dist/client/next.js
Error: Cannot find module 'babel-plugin-styled-components'
Require stack:
- /home/runner/work/adplist/adplist/node_modules/next/dist/compiled/babel/bundle.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/compiled/babel/code-frame.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/build/webpack-config.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/build/index.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/cli/next-build.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/bin/next
- If you want to resolve "styled-components", use "module:styled-components"
at loadPlugin.next (<anonymous>)
at createDescriptor.next (<anonymous>)
at Array.map (<anonymous>)
at Generator.next (<anonymous>)
> Build error occurred
Error: > Build failed because of webpack errors
EDIT 1: Here is the babel file.
{
"presets": ["next/babel"],
"plugins": [
[
"styled-components",
{ "ssr": true, "displayName": true, "preprocess": false }
]
],
"compact": false
}
Hope you can help me! :)

Related

Unable to build VueJS project in Azure Pipeline build

I have a large .NET website solution that has more than 30 projects in it, with some of them including VueJS. We have no problem building in any development environment, once we install all of the dependencies. However, Azure Pipeline is another thing...
The solution includes legacy webforms, MVC, DLL library, and the Vue projects (that are also webforms/core/mvc).
How can we adjust our Azure Pipeline to build the client apps the same way that local instances of Visual Studio does/can?
We can just build in debug/release mode without issue, by including the following commands in the build commands (in the project file, or included MSBuild script).
<Target Name="BuildVueClientApp">
<Message Text="Performing VueJS build." Importance="high"></Message>
<CreateItem Include="$(FullModulePath)\Scripts\client-app\**;">
<Output TaskParameter="Include" ItemName="deleteVueFiles" />
</CreateItem>
<Delete ContinueOnError="true" Files="#(deleteVueFiles)"></Delete>
<Exec Condition="$(Configuration) == 'Debug'" Command="npm run build-dev" />
<Exec Condition="$(Configuration) == 'Release'" Command="npm run build --prod" />
</Target>
I'm very new to Azure Pipelines, so please be descriptive. :)
Here is our current script:
trigger:
- development
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln;-:**\Examples*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller#1
- task: NuGetCommand#2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild#1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:BuildInParallel=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest#2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
Here is the package.json, just in case you need to know it.
{
"name": "client-app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build-dev": "vue-cli-service build --mode development",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.4",
"vue": "^2.6.11"
},
"devDependencies": {
"#vue/cli-plugin-babel": "~4.3.0",
"#vue/cli-plugin-eslint": "~4.3.0",
"#vue/cli-service": "~4.3.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {
"no-fallthrough": "off",
"no-undef": "warn",
"no-unused-vars": "warn"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
If I need to provide any additional details to help you create an answer, please let me know. :)

How to resolve the error message "Unzipped size must be smaller than 262144000" after migrating to serverless webpack

I'm getting a size limit error for my lambda after migrating to serverless webpack! I've migrated to webpack to resolve the issue so something's not right if I'm still getting the same error, see below for the error message.
Many thanks!!
Error message
An error occurred: MainLambdaFunction - Resource handler returned
message: "Unzipped size must be smaller than 262144000 bytes (Service:
Lambda, Status Code: 400, Request ID: ..., Extended Request ID: null)"
(RequestToken: ..., HandlerErrorCode: InvalidRequest).
serverless.yml config
service: my-service-name
frameworkVersion: ">=1.1.0 <3.0.0"
plugins:
- serverless-webpack
custom:
webpack:
includeModules: true
packager: 'yarn'
package:
exclude:
- ./**
- "!node_modules/**"
include:
- js/**
- package.json
provider:
name: aws
runtime: nodejs12.x
stage: staging
region: eu-west-1
memorySize: 1024
timeout: 30
The lambda is using node, so my package.json is included below for reference.
package.json file
"dependencies": {
"aws-sdk": "2.77.0",
"currency-formatter": "^1.2.1",
"dot": "^1.1.2",
"lodash": "4.17.4",
"moment-timezone": "0.5.33",
"pg-native": "^2.2.0",
"source-map-support": "^0.4.2",
"winston": "3.2.1",
"winston-cloudwatch": "^2.0.6"
},
"devDependencies": {
"#types/chai": "^3.4.34",
"#types/currency-formatter": "^1.0.1",
"#types/dot": "^1.1.2",
"#types/elasticsearch": "^5.0.19",
"#types/lodash": "4.14.71",
"#types/moment-timezone": "^0.2.34",
"#types/node": "10.17.39",
"#types/source-map-support": "^0.2.28",
"chokidar": "^2.0.3",
"chokidar-cli": "^1.2.0",
"concurrently": "^3.5.1",
"semver": "^5.3.0",
"serverless": "^1.67.3",
"serverless-webpack": "^5.6.0",
"ts-loader": "^9.2.2",
"tslint": "5.16.0",
"tslint-eslint-rules": "5.4.0",
"typescript": "^3.3.1",
"webpack": "^5.65.0",
"webpack-node-externals": "^3.0.0"
}
}

npm install error in Bitbucket CI/CD pipeline

I have a pipeline set up for my Bitbucket repository that runs npm install if there is no node cache. Up until now it has worked fine, but the node cache was recently cleared, and now I'm getting the following output from Bitbucket (Pastebin link, due to character limit): https://pastebin.com/fY9TznNn
package.json:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.3.2",
"#testing-library/user-event": "^7.1.2",
"#types/geojson": "^7946.0.7",
"#types/google-libphonenumber": "^7.4.19",
"#types/google-map-react": "^2.1.0",
"#types/jest": "^24.0.0",
"#types/node": "^12.12.55",
"#types/react": "^16.9.49",
"#types/react-bootstrap": "^0.32.22",
"#types/react-dom": "^16.9.8",
"#types/react-modal": "^3.10.6",
"#types/react-router-dom": "^5.1.5",
"#types/supercluster": "^5.0.2",
"axios": "^0.21.1",
"bootstrap": "^4.5.2",
"enzyme": "^3.11.0",
"eslint": "^6.8.0",
"firebase": "^7.24.0",
"geojson": "^0.5.0",
"google-libphonenumber": "^3.2.14",
"google-map-react": "^2.1.3",
"node-sass": "^4.0.0",
"react": "^16.13.1",
"react-async": "^10.0.1",
"react-bootstrap": "^1.3.0",
"react-cool-img": "^1.2.4",
"react-dom": "^16.13.1",
"react-dropzone": "^11.3.2",
"react-modal": "^3.12.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.4",
"supercluster": "^7.1.0",
"typescript": "^3.2.1",
"use-supercluster": "^0.2.9"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "npx prettier --write src && npx eslint src --fix --ext .ts --ext .tsx"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"#types/enzyme": "^3.10.8",
"#types/enzyme-adapter-react-16": "^1.0.6",
"#typescript-eslint/eslint-plugin": "^3.10.1",
"#typescript-eslint/parser": "^3.10.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": "^7.23.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"eslint-plugin-sort-keys-fix": "^1.1.1",
"prettier": "^2.1.1"
}
}
bitbucket-pipelines.yml:
image: node
definitions:
steps:
- step: &lint
name: Check code style
script:
- npm install # this is where the error occurs
- npx eslint **/*.ts[x]
caches:
- node
- step: &build
name: Build and test
script:
- echo > ".env"
- echo REACT_APP_GOOGLE_API_KEY=$GOOGLE_API_KEY >> ".env"
- echo REACT_APP_HANDSHAKE_API_KEY=$HANDSHAKE_API_KEY >> ".env"
- npm install
- npm run test
- npm run build
artifacts:
- build/**
caches:
- node
- step: &deploy
name: Deploy to Firebase
script:
- cd functions
- npm install
- cd ..
- pipe: atlassian/firebase-deploy:1.0.0
variables:
FIREBASE_TOKEN: $FIREBASE_TOKEN
PROJECT_ID: $FIREBASE_PROJECT
pipelines:
pull-requests:
"**":
- step: *lint
- step: *build
branches:
master:
- step: *lint
- step: *build
- step: *deploy
I'm concerned it might have something to do with the node-sass package as I've experienced issues with it before, and it's the first dependency to appear in the error. But I'm really not sure how to interpret this output or how to fix it. Thanks for any help!
Looks like my intuition was right—it was because of the node-sass package. Apparently it's deprecated. Installing sass instead fixed the problem!

Npm server not available after docker compose

I'm fairly new to docker. I was trying to separate my web app on modules for backend (django), frontend (react) and with some postgres db.
Here is my docker-compose.yml :
version: "3.8"
services:
db:
image: postgres
container_name: postgres
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- ./private/posgtesql/data/data:/var/lib/postgresql/data
app:
build: .
container_name: app
working_dir: /app/label_it
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
- db
front:
build:
context: ./label_it
dockerfile: Dockerfile
container_name: front
command: npm run dev
working_dir: /app/label_it/front
volumes:
- ./label_it/front:/app/label_it/front
- ./label_it/front/node-modules:/app/./label_it/front/node_modules
ports:
- "8001:8000"
depends_on:
- app
Django side runs like dream, browsing 127.0.0.1:8000 responses with server site. BUT.
There is nothing on 127.0.0.1:8001.
Correct me if I'm wrong, but I should be getting both servers for django AND for react on respecting ports??
Searched whole internet looking for solution. All I found was to check if node server actually runs on 0.0.0.0:8001 and it does according to :
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
baa18d3bfa73 labeling-lab-platform_front "docker-entrypoint.s…" 24 minutes ago Up 24 minutes 3000/tcp, 0.0.0.0:8001->8000/tcp front
6a76ba3a901b labeling-lab-platform_app "python manage.py ru…" About an hour ago Up 24 minutes 0.0.0.0:8000->8000/tcp app
c0d1d27ed930 postgres "docker-entrypoint.s…" About an hour ago Up 24 minutes 5432/tcp postgres
It's my second day dealing with this issue and I'm realy stuck.
EDIT:
my package.json with declared dev server:
{
"name": "static",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack --mode development --watch",
"build": "webpack --mode production"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"#babel/plugin-proposal-class-properties": "^7.12.1",
"#date-io/date-fns": "^1.3.13",
"#emotion/core": "^11.0.0",
"#emotion/react": "^11.1.4",
"#emotion/styled": "^11.0.0",
"#material-ui/core": "^5.0.0-alpha.20",
"#material-ui/data-grid": "^4.0.0-alpha.17",
"#material-ui/icons": "^4.11.2",
"#material-ui/pickers": "^3.2.10",
"#material-ui/unstyled": "^5.0.0-alpha.20",
"axios": "^0.21.1",
"babel-preset-react": "^6.24.1",
"clsx": "^1.1.1",
"date-fns": "^2.16.1",
"react-desktop-notification": "^1.0.9",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"react-window": "^1.8.6",
"react-window-infinite-loader": "^1.0.5",
"redux": "^4.0.5",
"regenerator-runtime": "^0.13.7",
"xlsx": "^0.16.9"
},
"devDependencies": {
"#babel/core": "^7.12.10",
"#babel/preset-env": "^7.12.11",
"#babel/preset-react": "^7.12.10",
"babel-loader": "^8.2.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"webpack": "^5.11.0",
"webpack-cli": "^4.3.0"
}
}

expo-detox-hook is not installed in your osx Library (Expo + Detox + Travis)

ERROR
Travis build fails with the following error
expo-detox-hook is not installed in your osx Library. Run `npm install -g expo-detox-cli && expotox clean-framework-cache && expotox build-framework-cache` to fix this.
Environment
NOTE: This is my local environment and not the travis environment
Expo CLI 3.12.0 environment info:
System:
OS: macOS 10.14.4
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.12.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
IDEs:
Android Studio: 2.3 AI-162.3871768
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
expo: ^36.0.2 => 36.0.2
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4
react-navigation: ^3.11.1 => 3.13.0
npmGlobalPackages:
expo-cli: 3.12.0
Steps to Reproduce
Push code to travis with the following .travis.yml, package.json, and setup.sh
.travis.yml
---
language: node_js
node_js:
- node
- lts/*
env:
global:
- NODE_VERSION=stable
addons:
homebrew:
packages:
- applesimutils
taps: wix/brew
install:
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
- export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- nvm alias default $NODE_VERSION
- npm install -g react-native-cli
- npm install -g expo-detox-cli && expotox clean-framework-cache && expotox build-framework-cache
- yarn add --dev detox \ detox-expo-helpers \ expo-detox-hook
cache:
directories:
- ~/.npm
- .jest
before_script:
- npm install -g npm#latest
script:
- npm ci
- npx jest --ci
- ./script.sh
- detox build --configuration ios.sim
- detox test --configuration ios.sim --cleanup
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"test": "jest"
},
"dependencies": {
"#expo/vector-icons": "^10.0.6",
"#ptomasroos/react-native-multi-slider": "^1.0.0",
"#react-native-community/masked-view": "0.1.5",
"#react-native-community/netinfo": "4.6.0",
"apollo-boost": "^0.3.1",
"apollo-cache-hermes": "^0.8.10",
"apollo-cache-inmemory": "^1.5.1",
"apollo-cache-persist": "^0.1.1",
"apollo-client": "^2.6.8",
"apollo-link": "^1.2.9",
"apollo-link-context": "^1.0.15",
"apollo-link-error": "^1.1.8",
"apollo-link-http": "^1.5.12",
"apollo-link-state": "^0.4.2",
"apollo-link-ws": "^1.0.15",
"aws-sdk": "^2.432.0",
"axios": "^0.19.0",
"expo": "^36.0.2",
"expo-analytics-amplitude": "~8.0.0",
"expo-app-auth": "~8.0.0",
"expo-asset": "~8.0.0",
"expo-av": "~8.0.0",
"expo-facebook": "~8.0.0",
"expo-file-system": "~8.0.0",
"expo-font": "~8.0.0",
"expo-google-app-auth": "^6.0.0",
"expo-image-picker": "~8.0.1",
"expo-linear-gradient": "~8.0.0",
"expo-permissions": "~8.0.0",
"graphql": "^14.1.1",
"lodash.flowright": "^3.5.0",
"moment": "^2.24.0",
"react": "16.9.0",
"react-apollo": "^3.1.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",
"react-native-appearance": "~0.3.1",
"react-native-aws3-cognito": "0.0.2",
"react-native-check-box": "^2.1.7",
"react-native-datepicker": "^1.7.2",
"react-native-dialog": "^5.6.0",
"react-native-dotenv": "^0.2.0",
"react-native-easy-toast": "^1.2.0",
"react-native-email-link": "^1.7.1",
"react-native-emoji": "^1.8.0",
"react-native-gesture-handler": "~1.5.0",
"react-native-image-view": "^2.1.4",
"react-native-keyboard-aware-scroll-view": "^0.8.0",
"react-native-modal": "^11.5.3",
"react-native-modalbox": "^2.0.0",
"react-native-picker-select": "^6.1.0",
"react-native-reanimated": "~1.4.0",
"react-native-safe-area-context": "0.6.0",
"react-native-screens": "2.0.0-alpha.12",
"react-native-snap-carousel": "^3.7.5",
"react-native-svg": "9.13.3",
"react-native-svg-charts": "^5.2.0",
"react-native-swipe-list-view": "^2.1.3",
"react-native-thumbnail-video": "^0.1.2",
"react-navigation": "^3.11.1",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"sentry-expo": "^2.0.1",
"subscriptions-transport-ws": "^0.9.15"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"babel-plugin-react": "^1.0.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-preset-expo": "^5.0.0",
"detox": "^15.3.0",
"detox-expo-helpers": "^0.6.0",
"eslint": "^5.15.1",
"eslint-config-equimper": "^2.2.2",
"eslint-config-react-app": "^3.0.7",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-class-property": "^1.1.0",
"eslint-plugin-flowtype": "^3.4.2",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-native": "^3.6.0",
"expo-codemod": "^1.0.6",
"expo-detox-hook": "^1.0.10",
"jest-expo": "^36.0.1",
"metro-react-native-babel-preset": "^0.53.1",
"react-native-testing-library": "^1.12.0",
"react-test-renderer": "^16.12.0",
"reactotron-react-native": "^3.2.1",
"url": "^0.11.0"
},
"jest": {
"preset": "jest-expo",
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element|#react-native-community|expo(nent)?|#expo(nent)?/.*|react-navigation|#react-navigation/.*|#unimodules/.*|unimodules|#sentry/.*|sentry-expo|native-base|react-native-multi-slider|#ptomasroos/.*)"
],
"setupFilesAfterEnv": [
"<rootDir>/setupTests.js"
],
"collectCoverage": true,
"collectCoverageFrom": [
"**/*.{js,jsx}",
"!**/coverage/**",
"!**/node_modules/**",
"!**/babel.config.js",
"!**/jest.setup.js"
]
},
"private": true,
"detox": {
"test-runner": "jest",
"configurations": {
"ios.sim": {
"binaryPath": "bin/Exponent.app",
"type": "ios.simulator",
"name": "iPhone 8"
}
}
}
}
setup.sh
#!/bin/bash -e
# query expo.io to find most recent ipaUrl
IPA_URL=`curl https://expo.io/--/api/v2/versions | python -c 'import sys, json; print json.load(sys.stdin)["iosUrl"]'`
# download tar.gz
TMP_PATH=/tmp/exponent.tar.gz
wget -O $TMP_PATH $IPA_URL
# recursively make app dir
APP_PATH=bin/Exponent.app
mkdir -p $APP_PATH
# unzip tar.gz into APP_PATH
tar -C $APP_PATH -xzf $TMP_PATH
Expected Behavior
Travis environment is setup and tests run successfully
Actual Behavior
Tests fail due to what appears to be a missing dependency
ERROR:
expo-detox-hook is not installed in your osx Library. Run `npm install -g expo-detox-cli && expotox clean-framework-cache && expotox build-framework-cache` to fix this.
Reproducible Demo
Can attempt to provide a demo project if necessary

Resources