Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,162,811 members, 7,851,720 topics. Date: Thursday, 06 June 2024 at 06:21 AM |
Nairaland Forum / Science/Technology / Programming / Npm Run Build Problem (react) (649 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)
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 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: 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: |
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: 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: 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: 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: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: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: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:Yeah. In your browser it’ll be bundled to one bundle.js file. |
(1) (Reply)
Web Developers In The House Please Help Me / Obama Encourages Students To Learn Computer Programing(exclusive Video) / Website
(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. 17 |