Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put website up #148

Closed
RichardLitt opened this issue Dec 12, 2017 · 10 comments
Closed

Put website up #148

RichardLitt opened this issue Dec 12, 2017 · 10 comments
Milestone

Comments

@RichardLitt
Copy link
Owner

Sweet.

@RichardLitt
Copy link
Owner Author

Current plan: Use Heroku.

Issue: backend and react-scripts use two different ports, which you can't do on Heroku. So, instead, we need to set up an mLab integration and ensure that we're not using two ports. I think.

@RichardLitt RichardLitt added this to the Live Website milestone Dec 12, 2017
@colinjnash
Copy link
Collaborator

colinjnash commented Dec 12, 2017

facebook/create-react-app#2271

So I'm currently looking into this. I'd love to hear what error people are getting when trying to deploy to Heroku.

Currently there is an issue with the HOST naming. I do believe there's a heroku builld that can work around this.

@RichardLitt
Copy link
Owner Author

Well, the build log seems fine:

-----> Node.js app detected
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
-----> Installing binaries
       engines.node (package.json):  8.9.1
       engines.npm (package.json):   5.5.1
       
       Resolving node version 8.9.1...
       Downloading and installing node 8.9.1...
       npm 5.5.1 already installed with node
-----> Restoring cache
       Loading 2 from cacheDirectories (default):
       - node_modules
       - bower_components (not cached - skipping)
-----> Building dependencies
       Installing node modules (package.json + package-lock)
       added 229 packages in 17.107s
-----> Caching build
       Clearing previous node cache
       Saving 2 cacheDirectories (default):
       - node_modules
       - bower_components (nothing to cache)
-----> Build succeeded!
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...
       Done: 84.1M
-----> Launching...
       Released v10
       https://the-travel-shelf.herokuapp.com/ deployed to Heroku

However, https://the-travel-shelf.herokuapp.com/ isn't.

@RichardLitt
Copy link
Owner Author

Running heroku local seems to throw up a site, although there are logged errors. So - I'm not sure what is different between the local and the remote heroku build. Any ideas?

@colinjnash
Copy link
Collaborator

Hmmm. I find it weird you're not getting anything now. I had an invalid host header. Do you have a web dyno running? Did it detect it? Can you post the Heroku build logs from the dashboard?

The local build is still relying on webpack-dev-server, and create-react-app's only downfall is not direct access to the webpack.

If you could post the heroku logs that would be great.

@RichardLitt
Copy link
Owner Author

I don't believe I have a web dyno running. Do I need a Procfile for that? I though it should automatically detect from the npm start script.

I believe the log issue is this:

2017-12-14T22:02:19.266235+00:00 app[web.1]: [0] react-scripts start exited with code 0
2017-12-14T22:02:19.240604+00:00 app[web.1]: [0] Something is already running on port 17770.

@colinjnash
Copy link
Collaborator

No procfile needed. I just wanted to make sure it picked it up, which it did. The conflicting port I didn't have with the react-scripts deploy, just the backend.

I was going to try and fool around with this heroku buildpack this weekend:

https://github.com/mars/create-react-app-buildpack

Feel free to look in there right now for the answer.

My best recommendation is to re-initalize the deploy and start from a fresh build, with the config vars needed put into the settings folder.

@RichardLitt
Copy link
Owner Author

Want to ping me the config vars needed, if they're different? I can try a new deploy.

@vlillies
Copy link
Collaborator

vlillies commented Dec 15, 2017

Pull request #162 has working code to launch on heroku.
It is required to go to the "settings" tab, click "Reveal Config Vars", and create an entry for MONGODB_URI as per our local .env file to serve data.

https://mysterious-tor-16246.herokuapp.com/

@RichardLitt
Copy link
Owner Author

Seems to work! https://the-travel-shelf.herokuapp.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants