create-react-app-buildpack | ⚛️ Heroku Buildpack for create-react-app : static hosting | Frontend Framework library
kandi X-RAY | create-react-app-buildpack Summary
kandi X-RAY | create-react-app-buildpack Summary
⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of create-react-app-buildpack
create-react-app-buildpack Key Features
create-react-app-buildpack Examples and Code Snippets
Community Discussions
Trending Discussions on create-react-app-buildpack
QUESTION
Im unable to deploy my react app to Heroku. It returns this error:
...ANSWER
Answered 2022-Apr-14 at 21:46Most likely your reference to your assets directory is wrong. While you import source code by referencing relative your current file, you should reference assets as if you are in your public directory.
Assuming you have a structure like
QUESTION
I am trying to deploy my first React.js app on Heroku. Everything seems to work fine link to app except the most important part - the Express.js REST API that I use to fetch data from my Postgres database and Stripe API is functioning normally on localhost, but when I deploy the app on Heroku, all the API routes I am trying to access return the same syntax error - Unexpected token < in JSON at position 0.
I understand that the issue is tied to how my app routes to the API. In other words, the fetch request is not able to get to the needed endpoint and thus return this syntax error, but I can't pinpoint exactly where is the issue - am I missing a '/' somewhere, have I incorrectly set up my environment variables, etc.?
Has someone had a similar issue or maybe someone can spot the issue in my code down below?
package.json
...ANSWER
Answered 2022-Feb-25 at 13:52I noticed that this question of mine is still unanswered.
The issue, in the end, was that I was trying to use the Heroku free plan, but my app was too "big" for that so I either needed to split the back-end and front-end into two apps or to use a paid plan.
In the end, I actually changed my hosting service provider from Heroku to Digital Ocean. The app is still on their servers and works now - https://dj-bbq-i5gdc.ondigitalocean.app/ .
QUESTION
Everything's sort of in the question, but here's some details. I have an monorepo structure like this, built on yarn workspaces:
...ANSWER
Answered 2021-Nov-18 at 16:02I've finally realized how to simulate the process on local: heroku/nodejs actually logs every step and every command it runs. You can find them, if in the dashboard you go to Your app -> Activity -> View build log (on one of the failed ones).
In my case yarn workspaces focus --all --production
was failing and the problem was that I had a postinstall
script that was installing husky, but husky itself is a dev dependency. I changed the postinstall script to prepare
, which is postinstall that runs on dev only and it fixed the problem.
QUESTION
I have an app that works fine locally using a .env
file. However, when I add my variable to Heroku as described in the heroku CRA buildpack
But when I run my application, I get an undefined
value.
How can I ensure that value populates properly?
Here's an example call I'm making in my app:
...ANSWER
Answered 2021-Jun-07 at 19:27Answer:
Added this to my webpack config (suggested in this thread heroku environment variables return undefined):
QUESTION
I am trying to enable basic authentication for a React app deployed to heroku, using the create-react-app buildpack, which includes the static buildpack. I succeed in enabling basic authentication - I get a login prompt - but the username and password that I configured via config variables are not accepted.
This is my configuration:
static.json
:
ANSWER
Answered 2021-Mar-31 at 02:02I found the answer myself here:
"BASIC_AUTH_PASSWORD
must be a hash of your password. Use command openssl passwd -apr1
to hash your password"
QUESTION
I have an app create in Heroku with a free account.
It's my first Nextjs app. I have created a few react apps and deployed them successfully using the https://github.com/mars/create-react-app-buildpack buildpack,
I am attempting to use the https://github.com/mars/heroku-nextjs.git buildpack. I continue to get the following error when pushing and attempting to build:
...ANSWER
Answered 2021-Mar-26 at 20:49remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: https://github.com/mars/heroku-nextjs.git
remote: -----> App not compatible with buildpack: https://github.com/mars/heroku-nextjs.git
remote: bash: /tmp/codon/tmp/buildpacks/cc998aa50faebde1ea66717737aec22c884e4936/bin/detect: No such file or directory
remote:
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
QUESTION
I'm seeing an issue on Heroku that I'm not having trouble with locally. I've seen various articles and other SO posts that address this issue, and I've got an understanding that it has something to do with properly configuring the static.json
file in my app in order for heroku to properly handle front end react routing, but I'm having some real trouble resolving this.
I'm using the following buildpacks and confirmed they're installed via the Heroku Dashboard > Settings:
https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku-community/static.tgz
https://github.com/mars/create-react-app-buildpack
Using a
gin-gonic
server and serving up./web
to serve the frontend as specified by my.Dockerfile
I have the following static.json:
ANSWER
Answered 2021-Feb-23 at 15:21So, none of the static.json solutions that I found while researching this issue seemed to work. From what I gather this appears to be a known issue with react routing and/or Heroku.
That being said, if this is helpful for anyone else that comes across this issue, this is how I addressed it:
Set up a NotFound handler on the server:
All this NotFound handler do is serve up your index.html file allowing your SPA framework to handle the routing itself (making the determination if valid or truly not found).
I achieved this in go/gin-gonic by:
QUESTION
I'm running two separate apps (Create-react-app frontend & a node/express backend) on Heroku. I'm trying to make a request from the info-screen.herokuapp.com to the info-screen-backend one.
This is the GET request handler:
...ANSWER
Answered 2020-Mar-10 at 18:17Should the API_URI not be https://info-screen.herokuapp.com
maybe it's just because the image cuts of part of the value but in your typed text you also leave out the protocol part of the url
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install create-react-app-buildpack
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page