Unable to deploy react application to heroku - javascript

so I just finished building the beta version of my e-commerce application and decided to deploy to heroku from my github repository.
The first issue I ran into was not npm run build (which I did then pushed it to github) then redeployed.
Next issue was my build failed because I didn't specify the version of node. (SO i want into the package.json and typed in...)
"engines": {
"node": "16.14.2"
},
Again, redeployed I got through the build and I thought all was well. BUT I get an application error (fun) and so I go into heroku logs to see what I did wrong. Problem is I actually don't know what i did wrong. This is what the log says

Related

unable to host slack bot on vercel

I've created a slack bot that I want to deploy with vercel and I keep getting the error:
Error: Command "npm run build" exited with 1
when running vercel deploy.
In my package.json file I have:
"build": "next build"
which is obviously incorrect as it throws this error.
The vercel docs suggest (https://vercel.com/docs/errors#error-list/missing-build-script)
"scripts": {
"build": "[my-framework] build --output public"
so my question is, what is actually expected in here in order to make this work?
I would really appreciate some help getting the project up and running so I can use it on slack. It works locally just fine, but can't get it up and running without me starting it locally.
Here is the repo: https://github.com/Chaffexd/weds-slack-bot
The correct build script for a nextjs app is next build.
Your script currently has npm run-script build.
Which is actually the equivalent of telling it to run itself over and over, it's self referencing.
Also, as an aside, your app is not going to work on Vercel. Vercel is a serverless environment, meaning long running applications like the one you have written that is continually listening on a port (I imagine when you run it locally it hangs for input) are not supported. You should refactor your app to respond to requests, which can trigger your function.
A good way of building this app on Vercel with NextJS might be to use the NextJS API folder for your application code, and then find a free CRON runner to repeatedly hit that function endpoint every day.

Build changes not reflected in deployed app

I have a Django/ Vue.js app that I deployed to Heroku. It's repo is connected to Heroku so I deploy it straight from the Heroku app.
I've updated the code and run "npm run build" afterward. I run 'git add *', checkd that every files where tracked, commit them and push them to the repo.
Afterward I did a manual deploy from the Heroku app. Deployment went fine but the changes are not reflected into my deployed app.
What went wrong? Did my build failed (had no error message while building and I did get the 'build Complet' message)
I don't know where to look at. How can I be sure the changes I made are reflected into my build?
What I tried:
-deleting the build folders and "run build" again with no luck
-force my browser to clean the cache with no luck either
What I did:
I wanted to change my login/logout url redirection

Unable to deploy react application to github pages

I am trying to deploy a simple react application, it worked the first time, but when i updated my code to github repo and tried to run 'npm run deploy', it failed
Below is my package.json
I am new to react and deploying apps to server
First, make sure to use the latest version of npm, as seen here, and in npm/npm issue 7768
Second, looking at the history of your AJ555/react-exp, gh-pages branch, start by reverting the last two commit (to get back to the state where the first deployment succeeded), and check if it is still working.
If it does work, then the issue is in the current last two commits.
I have this problem as well. What I do is restart my computer and then try run npm run deploy again.

Is it possible to run React project without npm start?

I'm in a big trouble. Working in a part time in a company they're looking for a new web technology to build "web-component" in their website.
They have started to use AngularJS (first version) and I told them that, with the recent evolution of this framework, it's not the right period of time to deal with it.
That's why I began to be interested in ReactJS. However, they don't have a node.js server infrastructure (and that's why AngularJS suits to them, only one browser is sufficient) so it's impossible to run it with something like "npm start".
SO ! My question is (as my post's title says...) :
Is it possible to run ReactJS without server side ?
I've tried with the following line in my header
<script src="https://unpkg.com/react#15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom#15/dist/react-dom.js"></script>
But it remains a blank page.
Maybe there is something I don't understant in the react structure and that's why I'm looking for some help/explanations from you.
I hope I have been clear enough ! Thank you in advance for answer.
It is absolutely possible to run a React app without a production node server. Facebook provides an easy-to-use project bootstrapper that you can read about here
That being said, developers may need to use a node dev server locally via npm start, as well as using node to perform production builds via npm run build. But one can take the build output from npm run build and serve it from any static server and have a working react application.
For those who are getting 404's after deploying in a sub directory. Make sure to add the path in package.json as homepage.
"homepage": "https://example.com/SUB-DIRECTORY",
You should insert "homepage": "./" into your package.json file, then use building react-script command like npm run build.
I did it by using serve, as part of the build step in Jenkins. To install it, execute the command:
npm install -g serve
Then, to serve it:
serve -s build
Please, refer to project page for more information: https://github.com/zeit/serve

Project broken by unidentified subdependency: how to recover? How to `npm install` with all packages limited by a date?

My project is successfully deployed via CI and working fine. But when I build it from the same commit locally, the project freezes without any error message. It's a huge Ember app with an enormous pipeline, and I've exhausted all my debugging ideas.
My only guess so far is that an npm subdependency update has broken something. I don't know which package is to blame. :(
I have no npm-shrinkwrap.json. I tried to introduce shrinkwrapping to the team, but it was causing too much trouble, so we went back to not using it.
No other team member has an up to date version of the project locally, so I don't have anyone to ask for a fresh npm-shrinkwrap.json.
I know the date at which the project was building correctly.
How do I tell npm to install every package (including subdependencies) limited by a date (in addition to restrictions specified in package.json files)?
If I were able to do that, I could see if the project starts working again. If it does, I could shrinkwrap and identify the troublesome package.
Any other suggestions to recover from this failure are also very welcome.
PS I'm using NVM, so I've tried both npm v2 and v3 -- same result.

Categories

Resources