Topic: Pro - Empty screen on the static IP
praveen pandey pro asked 6 years ago
<App> is not Rendered, Blank white screenI have downloaded the MDBootstrap Pro, I have downloaded the zip and started building my code on the same.I have made change to package.json to
"build": "react-scripts build" from "build": "webpack".
When I do a npm start the webpage loads fine, but when I do a 'npm run-script build' and serve it, it does not load on static IP, and shows me a blank screen.
I have spent more than 2 days trying to fix this but no luck.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Opened
Specification of the issue
- ForumUser: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Tags
praveen pandey pro commented 6 years ago
I have downloaded the MDBBootstrap Pro ZIP. I followed the instruction to install and start the npm which works fine. But the same is not working when I am trying to create a build for server deployment. The zip code as is does not help compile build, I have spent 2 days trying to figure out the issue.Bartłomiej Malanowski staff commented 6 years ago
could you please share your project with us?praveen pandey pro commented 6 years ago
Hi Bartlomiej, Please find the drive link - https://drive.google.com/file/d/1l7T3XQxflledyVItQ9643BoRL_26oUWV/view?usp=sharing Regards, Praveen Pandeypraveen pandey pro commented 6 years ago
I have been using "build": "react-scripts build" instead of "build": "webpack" as per the code sample, this generates the build folder. In the sample attached I have kept it as "build": "webpack".Mikołaj Smoleński staff commented 6 years ago
Hi, Your project is working after removing the following line from the SubCategoryHorizontalCards.js: import '../../../../node_modules/slick-carousel/slick/docs.cssMikołaj Smoleński staff commented 6 years ago
Also You don't need to write '../../../../node_modules/' because node_modules is the default folder. So, for example, instead of this: import '../../../../node_modules/slick-carousel/slick/slick-theme.css'; You can write: import 'slick-carousel/slick/slick-theme.css';praveen pandey pro commented 6 years ago
Hi Mikolaj, Thanks for your response and time. When we download the MDBPro zip the dist contains - 1.css 2.font 3.img 4.js 5.scss 6.index.html 7.mdbreact.js and other files Are these files supposed to be pasted manually if I happen to delete them, if not how can I generate the files?. For example - import '../dist/css/mdb.css'; in the index.js is referring dist, if I happen to delete this I will not be able to compile, can I access the mdb.css from docs/mdb.css. Also is there any documentation on how to create deployment build for the same. Hoping to hear soon. Regards, Praveen Pandey Republic World - <a href="http://www.republicworld.com/" rel="nofollow">http://www.republicworld.com/</a>praveen pandey pro commented 6 years ago
Hi, I have few more questions - what would be the right approach to generate the build, using webpack or "react-scripts build". even with the mentioned changes "react-scripts build" does not render the page right. Using webpack - npm run build and serving the dist works fine. but this does generate the manifest.json, I am sure I am missing something here. Please let us know what would be the right way to do this? Regards, Praveen PandeyMikołaj Smoleński staff commented 6 years ago
Hi, Why do You need to delete dist folder? We've added there everything You need to work with MDB React. We are using webpack and we strongly recommend to use it also in Your own projects. RegardsWington R. Brito pro commented 6 years ago
Hi @praveen pandey, I was having this same issue when I was deploying to AWS. I was able to get it to work and deployed it. The reason is that the webpack.base.config.js and the package.json are not properly configured to be deployed to prod on the MDBBootstrap Pro ZIP. You need to configure webpack.config to take the right entry point and the correct output. You also will need to configure your package.json to handle prod compile. Just similar to webpack.dev.config.js. I added some example links below: This is a simple one I did but you can get the idea from it: Webpack: https://gist.github.com/wingtonbrito/cfbcea00719dd83efdab94024e55829c package.json snippet: https://gist.github.com/wingtonbrito/5ddc0db9ea44044e02c6d906c8b7459dMikołaj Smoleński staff commented 6 years ago
Thanks for Your remarks! @praveen, is Wington's answer helpful for You?