Can't run mlflow standalone react server - reactjs

I need to run the frontend UI on a separate server as a stand-alone react app (not with all of the mlflow python server and packages). But when I run the production build, I get the following error:
You need to enable JavaScript to run this app.
Reproduce:
git clone https://github.com/mlflow/mlflow.git
cd mlflow/mlflow/server/js
In development mode, "npm start" it works just fine:
npm install
npm start
But when I've run it in production, I am getting the above error.
npm install
npm install -g serve
npm run build
serve -s build
I tried many things searching in forums, including this one:
I am getting error in console "You need to enable JavaScript to run this app." reactjs.
but I didn't manage to make it work.

Related

React server is not running through npm start

Good Evening I am doing a project in ReactJs through npm start project is compiling but has not started, loading for several minutes via localhost 3000 on google chrome. what should I do now?
Try to install Yarn using yarn install after that run following command
yarn start

React production build is returning 404 error

npx create-react-app app-name
cd app-name
npm start
works fine but
npm run build
cd build
serve -s build
return 404
It's inbuilt react code. I have not changed anything.
running in the development server but not in the production server.
Is there anything am I doing wrong here?

npm run build hangs no matter what, cannot upgrade webpack

I cloned a react repository and would like to run it. However, npm run build and npm start hang indefinitely.
I am trying to run the application on a CentOS 7 server which I access via ssh.
I am running:
npm install
and then
npm run build or npm start
Here is what I see:
my-project# build /local/scratch/my-project/app
webpack --mode development --progress
The progress does not seem to display.
I tried updating webpack with:
npm install --global webpack#4.29.6
I know that I need version 4.29.6 or higher. When I run this:
npm webpack --version
I still see version 3.10.10. My package.json file references version 4.29.6.
What should I try next?
Please let me know if I need to provide more information.
There are two mistakes I was making above:
1) npm webpack --version does not show the version of webpack. Instead, it shows my version of npm.
2) I should not have installed webpack globally - this caused issues. I should have installed it locally.
The app still doesn't work...but I can build and see error messages which is a big step forward.

gh-pages failing while trying to deploy Reactjs app to GitHub in windows 10

I tried following the exact instructions listed in the react documentation on how to deploy a working app to github pages. When I ran npm run deploy. It kept failing at the gh-pages -d build saying that the 'gh-pages' is not an internal or external command. I made sure I had the latest versions of node and npm installed
I had installed gh-pages using the -g tag to make it globally available. Tried adding to the system path variable leading to the node modules folder where i knew gh-pages was loaded. Still nothing.
Finally i tried running it from the git bash window instead of the cmd terminal. This hadn't occurred to me at first as all of the other npm commands worked. Don't know why this fixed things but it did. Just posting this so somebody else might be spared the pain
I had the same issue but finally managed to make it work. The main issue was that I hadn't installed Git for Windows, but I took some extra steps to make sure everything works fine.
Download and install Git for Windows from here
Run npm cache clean to clean npm cache
Run npm install npm#latest -g to install the latest version of npm
Add "homepage" : "http://myname.github.io/myapp", to
"package.json" file and replace the URL with correct GitHub pages URL. If you are not sure about the URL, open the project repository in the browser and go to "Settings" tab. Scroll down and find correct URL under "GitHub Pages".
Run npm install --save-dev gh-pages to install gh-pages module
Add the following 2 lines to "scripts" object in "package.json" file:
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
Finally, run npm run deploy to create an optimized production
build and deploy it on GitHub pages. If you haven't logged in to
Github for windows app before, Github app pops up and asks you to enter your username and password. When you've done that the deploy process will continue and uploads the production build on GitHub pages.
Hope that helps, happy coding.
If it says this, then node_modules/.bin/gh-pages doesn't exist (no, you don't need to install it globally). If it doesn't exist, then it means you either forgot to run npm install --save-dev gh-pages, or something went wrong during the installation.
I would not recommend installing it globally (although looks like it worked in your case).

How to run "Grunt serve" command on live hosting?

I have made one angular app. this app in use grunt and run application using "Grunt Serve" command. But, I have uploads this application on live hosting. so, please help me... How to run "Grunt serve" command on live hosting?
Achieve that by following steps:
Make sure node.js is installed on hosting instance
Make sure you app has proper package.json that contains grunt
dependencies used by your app
Connect to host machine and run npm install (via putty or ssh or
....)
After packages are installed you can run grunt serve manually or you
can put that command in postinstall script of package.json to auto
run after npm install is done

Resources