Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,013 members, 7,817,986 topics. Date: Sunday, 05 May 2024 at 01:49 AM

Npm Run Build Problem (react) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Npm Run Build Problem (react) (606 Views)

Help Needed With NPM ERR! / Please Help I'm Getting Errors Why Installing Npm On Termux / Issue Which Nodejs And Npm After Installation (2) (3) (4)

(1) (Reply) (Go Down)

Npm Run Build Problem (react) by Fourpockets: 10:20pm On Aug 13, 2022
I want to compile my react(jsx) into html that the browser can read, but even after running the "npm run build" command, the index.html file in the build folder is still empty after I open it in my browser

Please how can I compile my react app undecided cry





Also is it just me or does nairaland look different
Re: Npm Run Build Problem (react) by Qtrpst4: 10:32pm On Aug 13, 2022
What do you want to do?
Have you done react before or this is your first
Re: Npm Run Build Problem (react) by Deicide: 10:43pm On Aug 13, 2022
npm start
Re: Npm Run Build Problem (react) by Fourpockets: 11:41pm On Aug 13, 2022
Qtrpst4:
What do you want to do?
Have you done react before or this is your first

I want to compile my react app
Re: Npm Run Build Problem (react) by Qtrpst4: 2:45am On Aug 14, 2022
If you have already started then npm start
But if you are yet to start
(a) "npx create-react-app <the name of your project>
(b) cd <your project name>
(c) npm start


Fourpockets:


I want to compile my react app
Re: Npm Run Build Problem (react) by Nobody: 11:31am On Aug 14, 2022
After building your react app you won’t find your compiled Js in the index.html file as this would always be empty. Your compiled react app IS the bundle.js file.
If you’re trying to see what your react app looks like after it’s been compiled, don’t bother; it’s not a bunch of html tags and JS, it’s a gigantic unreadable file.
Re: Npm Run Build Problem (react) by Fourpockets: 11:45am On Aug 14, 2022
Rgade:
After building your react app you won’t find your compiled Js in the index.html file as this would always be empty. Your compiled react app IS the bundle.js file.
If you’re trying to see what your react app looks like after it’s been compiled, don’t bother; it’s not a bunch of html tags and JS, it’s a gigantic unreadable file.

Oh, I saw the file and opened it in my browser but it still can't read it, what if I want to host the file?, Is that the only file I'd have to upload ?
Re: Npm Run Build Problem (react) by Fourpockets: 12:36pm On Aug 14, 2022
Qtrpst4:
If you have already started then npm start
But if you are yet to start
(a) "npx create-react-app <the name of your project>
(b) cd <your project name>
(c) npm start



I've done those already and finished building the react app. It's remaining for me to deploy it or upload it to GitHub
Re: Npm Run Build Problem (react) by chukwuebuka65(m): 1:19pm On Aug 14, 2022
Fourpockets:
I want to compile my react(jsx) into html that the browser can read, but even after running the "npm run build" command, the index.html file in the build folder is still empty after I open it in my browser

Please how can I compile my react app undecided cry





Also is it just me or does nairaland look different

Install an npm package called serve globally thus:
npm install -g serve. Then run the app thus:
serve -s build
Re: Npm Run Build Problem (react) by Nobody: 1:40pm On Aug 14, 2022
Fourpockets:


Oh, I saw the file and opened it in my browser but it still can't read it, what if I want to host the file?, Is that the only file I'd have to upload ?
You still can’t read it? As in you don’t understand it’s content? Well you shouldn’t be able to. You shouldn’t be concerned about your bundle.js file as long as your app’s working fine.
Nah you can’t just upload the file for hosting, you need the entire build folder for that.
Re: Npm Run Build Problem (react) by Nobody: 1:46pm On Aug 14, 2022
Fourpockets:


I've done those already and finished building the react app. It's remaining for me to deploy it or upload it to GitHub
If your concern is just to host your app, then don’t bother yourself about the build process, at least at this stage.
You can just use Netlify for hosting. It takes care of the build process for you. Just push your code to a GitHub repo then go to netlify and link that repo.
Re: Npm Run Build Problem (react) by Fourpockets: 2:42pm On Aug 14, 2022
Rgade:

You still can’t read it? As in you don’t understand it’s content? Well you shouldn’t be able to. You shouldn’t be concerned about your [b] bundle.js [/b]file as long as your app’s working fine.
Nah you can’t just upload the file for hosting, you need the entire build folder for that.
Just to be clear,
By bundle.js do you mean these Js files

Re: Npm Run Build Problem (react) by Nobody: 4:15pm On Aug 14, 2022
Fourpockets:

Just to be clear,
By bundle.js do you mean these Js files
Yeah. In your browser it’ll be bundled to one bundle.js file.

(1) (Reply)

My Journey Into Web Development / Two Nigerians Boost Online Transactions With New Apps / Dynamic Websites For Your Use For Free!!!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.