Closed H1net closed 6 years ago
@H1net I think you have forgot to do step 2 of these instructions: https://github.com/sysgears/apollo-universal-starter-kit#deploying-to-heroku
Not unless this is incorrect...
@H1net Sorry, we should have updated docs for Yarn. In the case of Yarn, which is used now, the config var should have a name YARN_PRODUCTION
and a value false
That's the winner @vlasenko thanks! I also note that FALSE needs to be lowercase or it still fails.
Argh... I'm about ready to give-up and deploy this manually on a digital ocean droplet. Ideas on the below? I disabled the ios/android in order to try and get the web-build working first.
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=false
YARN_PRODUCTION=false
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): >= 6.11.1
engines.npm (package.json): >= 3.10.3
engines.yarn (package.json): >= 0.19.0
Resolving node version >= 6.11.1...
Downloading and installing node 9.3.0...
Bootstrapping npm >= 3.10.3 (replacing 5.5.1)...
npm 5.6.0 installed
Resolving yarn version >= 0.19.0...
Downloading and installing yarn (1.3.2)...
Installed yarn 1.3.2
-----> Restoring cache
Skipping cache restore (not-found)
-----> Building dependencies
Installing node modules (yarn.lock)
yarn install v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/traveling-fastlane-darwin@1.0.15: The platform "linux" is incompatible with this module.
info "@expo/traveling-fastlane-darwin@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "antd > rc-editor-mention@1.1.1" has unmet peer dependency "immutable@~3.7.4".
warning "antd > react-slick@0.15.4" has incorrect peer dependency "react@^0.14.0 || ^15.0.1".
warning "antd > react-slick@0.15.4" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.1".
warning "antd > react-slick > slick-carousel@1.8.1" has unmet peer dependency "jquery@>=1.8.0".
warning " > bootstrap@4.0.0-beta.2" has unmet peer dependency "jquery@1.9.1 - 3".
warning " > bootstrap@4.0.0-beta.2" has unmet peer dependency "popper.js@^1.12.3".
warning "expo > react-native-maps@0.17.1" has unmet peer dependency "prop-types@^15.5.10".
warning "expo > react-native-svg@5.5.1" has unmet peer dependency "prop-types@^15.5.8".
warning " > react-ga@2.3.5" has unmet peer dependency "prop-types@^15.5.10".
warning " > react-native@0.50.3" has incorrect peer dependency "react@16.0.0".
warning " > babel-loader@7.1.2" has unmet peer dependency "babel-core@6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc".
warning "exp > xdl > glob-promise@3.3.0" has unmet peer dependency "glob@*".
warning "jsdom > request-promise-native@1.0.5" has unmet peer dependency "request@^2.34".
warning " > haul@1.0.0-beta.10" has unmet peer dependency "babel-preset-react-native@^2.0.0".
warning " > mocha-webpack@0.7.0" has incorrect peer dependency "mocha@^2.4.5 || ^3.0.0".
warning " > mocha-webpack@0.7.0" has incorrect peer dependency "webpack@^1.12.13 || ^2.1.0-beta.15".
[4/4] Building fresh packages...
$ opencollective postinstall
*** Thank you for using casemcnair! ***
Please consider donating to our open collective
to help us maintain this package.
https://opencollective.com/apollo-universal-starter-kit/donate
***
Done in 141.59s.
Running heroku-postbuild (yarn)
yarn run v1.3.2
$ rm -rf build && spin exp login -u $EXP_USERNAME -p $EXP_PASSWORD --non-interactive && spin -c .spinrc.prod.json build && spin exp p --non-interactive && npm run seed
[exp] There is a new version of exp available (47.1.1).
You are currently using exp 46.0.6
Run `npm install -g exp` to get the latest version
Success. You are now logged in as h1net.
webpack-for-server Time: 28375ms
webpack-for-web Time: 49570ms
spin info Starting Expo prod server
spin info Production mobile packager listening on http://localhost:3030
spin info Expo server running on address: exp://localhost:19000
[exp] There is a new version of exp available (47.1.1).
You are currently using exp 46.0.6
Run `npm install -g exp` to get the latest version
[exp] Publishing...
[exp] Building iOS bundle
spin error Bundle for 'ios' platform is missing! You need to build bundles both for Android and iOS.
[exp] 404 - "{'message': 'File not found: build/client/ios/index.mobile.bundle'}"
[exp] Set EXPO_DEBUG=true in your env to view the stack trace.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
what does your .spinrc.prod.json
looks like?
{
"builders": {
"server": {
"stack": ["server", "react-native-web"],
"backendUrl": "http://localhost:8080/graphql",
"enabled": true
},
"web": {
"stack": ["web", "react-native-web"],
"openBrowser": true,
"enabled": true
},
"android": {
"stack": ["react-native", "android"],
"enabled": false
},
"ios": {
"stack": ["react-native", "ios"],
"enabled": false
},
"test": {
"stack": ["react-native-web", "server"],
"roles": ["test"]
}
},
"options": {
"backendBuildDir": "build/server",
"frontendBuildDir": "build/client",
"dllBuildDir": "build/dll",
"overridesConfig": "tools/webpackAppConfig.js",
"stack": ["apollo", "react", "styled-components", "sass", "less", "es6", "webpack"],
"backendUrl": "https://casemcnair-demo.herokuapp.com/graphql",
"ssr": true,
"webpackDll": true,
"devProxy": true,
"reactHotLoader": false,
"persistGraphQL": false,
"frontendRefreshOnBackendChange": true
}
}
Though for the record I will want ios/android on eventually obviously. I'm just trying to get a demo up for initial feedback on a new property tracker for an estate agent.
@H1net Change your heroku-postbuild step to this:
"heroku-postbuild": "rm -rf build && spin -c .spinrc.prod.json build && npm run seed"
and edit .spinrc.prod.json
@H1net This all has to do with heroku-postbuild
and what it uses
@vlasenko thanks again
I don't seem to be able to deploy to heroku. Is this something I'm doing wrong with my app setup or problem with the starter-kit? I note I have andoird/ios disabled in app.json atm.