Vite manifest not found laravel hostinger - node.js

we uploaded our working laravel code on hostinger (shared servers).
Once uploaded we are having this error : Vite manifest not found at: /home/.../blog/public/build/manifest.json
Missing Vite Manifest File
We deleted the line #vite(['resources/css/app.css', 'resources/js/app.js']) from the code.
the application works this time but css and js of login doesn't work.
Do you have any idea of the issue please ?
Best regards,

Hello There hope it's not late.
In order to use vite in your Laravel project for the installed UI files in the Authentication Module, you have to migrate to your project and run the following commands.
npm install
npm run dev
But as long as you are in production run the below command.
npm run build
Then you'll be good to go.

shared hosting is sucks because we don't have ssh access and have very limited choice to do. But it is really cheap. so here is what I do to upload laravel 9 with vue.js on board with vite at hostinger shared hosting.
run npm run build on local
upload all files outside public_html
copy all the data at public directory to public_html. (copy not move)
that should resolve Vite manifest not found error

Related

index.html not found while deploying MERN app to render.com

I was trying to deploy my MERN based E-commerce website on render.com, after the render terminal shows the build was successful the the webpage shows the error as,
{“message”:“ENOENT: no such file or directory, stat ‘/opt/render/project/src/frontend/build/index.html’”,“stack”:null}
I’m a complete beginner to render and MERN too,
I have no bulid folder in my local
then I tried to create another test app by npx create-react-app test to check if build folder is actually present in there or not, But it is not there, I’m totally in Confused now…
I’m Giving my repo here → stunning spark
I just want to have clear answers for my questions(Please!!!)
Things I want to change in my directory to deploy and host my app Successfully.
Things Need to be configured in the render’s settings
Thanks in Advance!!!
I just want to deploy and host my application on render.com
Just run npm run build into your frontend folder and do check you have removed the "build" keyword from the .gitignore file because it won't let you push the build folder to GitHub and you are good to go.

I can't start my NextJS js app using plesk

I'm trying to start a NextJS application on my Node server using Plesk but it is not working. I activated NodeJS for my Plesk environment, and I was able to run npm install and npm build, but now, when I try to start the application, Plesk only shows "Please wait" and stays like that with no change, I have been waiting for more than 2 hours now, but I don't get any results, no errors, nothing.
The only issue I can think of is that, according to what I could find, the Application startup file and the package.json file should be in the same directory, the root folder, but in my case this is not possible. I have my package.json in the root directory, but the startup file for NextJS, index.js, is inside the pages folder. I tested building and starting the app locally and everything works fine, I don't understand why it's not working with Plesk.
I was able to fix this after correcting the startup file, it should be "node_modules/.bin/next" and not "pages/index.js".
Also when you start your app, Plesk will tell you to wait. Just check the site and make sure it is running, if it is, you can close Plesk.
You might need to install Express in your Next.js
You may refer to this repo fmi # https://github.com/zeit/next.js/tree/canary/examples/custom-server-express
If you're referring to the package.json's command we'll have:
dev
build
start
In Plesk's Node Application extension.
Website & Domains > "Your Domain" > Enable Node.js
Simply set server.js as my Application Startup File.
Ensure that all dependencies is installed using "Npm Install" helper.
You must run build command before start command.
Screenshot:
Helpful NPM/Plesk reference:
Running scripts in Node.js Application
Adding .npmrc file in Node.js Application Root folder

React npm run build, what is that, why we need that?

Currently I made a simple app with react, it works perfectly and I use react-scripts. I installed React by following the Facebook github page, and it written that "When you're ready to deploy to production, running npm run build will create an optimized build of your app in the build folder. ". After I press npm run build, a folder build created, but I do not know what to do with this folder. I tried some method like, move all folders except build and npm run, but it did not work. Anyone can explain me what is this folder "build" ? Thank you
npm run build builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
npm run build creates a build directory with a production build of your app. Set up your favourite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main..js are served with the contents of the /static/js/main..js file.

Which files from Node.js app must be uploaded to a web-hosting?

Perhaps this is a silly question. It came out while I was learning how to set up a Node.js application for production on Ubuntu and digital ocean.
Let's say I have a simple data visualization app made in Node.js, using node modules such as express, page, axios, yo-yo, and browserify to compile my files.
I want to upload my app to a webhost that already exists.
This is the structure's app:
node_modules
public (app.js and app.css)
src (header, home, and footer folders)
views (index.pug file)
gulpfile.js
index.scss
package.json
server.js
Which files I need to upload in order to see my app as I see it in localhost?
You need to upload everything.
What Maximelian says is true if you're going to run npm install again on your server. The standard way of doing this is sync the project using git (you can find a .gitignore template for node.js here).
Once setup you'd do something like this on the server after making the commit locally, and pushing to your remote git repo:
git pull
npm install
npm start
If you were to just ftp the full working project including node_modules it would work just by running npm start. But the above method is what I'd recommend.
If I remember correctly everything except node_modules, if you did not customized them. (rewrite some behavior after module installation)

Should I upload the gulpfile.js, package.json and source files to production?

I am hosting my website on GitHub. I am using npm and Gulp.
Should I upload my package.json file, the gupfile.js and the build/ folder (CSS and JS source files) to my production server?
Normally for a production environment, you do not upload the gulpfile.js to the production server unless there is a specific task you have written that pertains only to your production environment. Your build folder would get uploaded along with your package.json, since then all you will need to do on your production server once the app is uploaded would be to npm install and then start your server.
I know it wasn't a part of your question, but since you are on the topic of putting an app into production, I would highly suggest using forever to run your application. It's really friendly with node. Hope this helps.

Resources