# Ionic 4 cannot build for browser

**URL:** <https://forum.ionicframework.com/t/ionic-4-cannot-build-for-browser/177287>\
**Category:** Ionic Framework\
**Created:** [November 10, 2019, 7:11pm UTC](https://forum.ionicframework.com/t/ionic-4-cannot-build-for-browser/177287 "2019-11-10T19:11:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kin](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@Kin](https://forum.ionicframework.com/u/Kin)\
**Post date:** [November 10, 2019, 7:11pm UTC](https://forum.ionicframework.com/t/ionic-4-cannot-build-for-browser/177287/1 "2019-11-10T19:11:02Z")

</div>

Hi all, I’m unfortunately having difficulty deploying my ionic project for web. No matter what I do, commands such as 'ionic build, ‘ionic build --prod’, ‘ng build --prod’, or whatsoever always create a www folder that is incorrect. The index.html in this www folder is always blank when viewed from a browser.

I’ve tested this issue on other ionic projects as well (just generated some from templates) and the same issue occurs here, with the index.html in the www folder always being displaying a blank site. If possible, I’d appreciate any help if that’s OK!

---

<div class="post-metadata">

**Author:** ![dzakyr](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dzakyr/32/129224_2.png) [@dzakyr](https://forum.ionicframework.com/u/dzakyr)\
**Post date:** [November 11, 2019, 3:36am UTC](https://forum.ionicframework.com/t/ionic-4-cannot-build-for-browser/177287/2 "2019-11-11T03:36:54Z")

</div>

have you tried **ionic serve**? like [this](https://ionicframework.com/docs/v3/cli/serve/) documentation?

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [November 11, 2019, 9:50pm UTC](https://forum.ionicframework.com/t/ionic-4-cannot-build-for-browser/177287/3 "2019-11-11T21:50:35Z")

</div>

Can you explain more about how you are trying to deploy the app and what exact process causes the “blank” page? I’m specifically interested in the URL being used - if it’s anything other than `/`, you are likely going to have to concern yourself with the `baseHref` and `deployUrl` options in `angular.json`.

---

<div class="post-metadata">

**Author:** ![Kin](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@Kin](https://forum.ionicframework.com/u/Kin)\
**Post date:** [November 12, 2019, 1:09pm UTC](https://forum.ionicframework.com/t/ionic-4-cannot-build-for-browser/177287/4 "2019-11-12T13:09:52Z")

</div>

Managed to get it fixed, thank you guys! It seems that my issue was due to an incorrect server.js file (the console.log kept spitting out an error about incorrect MIME types) and the fact that I was opening the www folder directly by opening the index.html folder instead of using ionic serve inside. baseHref is still ‘/’ and seems to work, believe it was just me mistakenly not using ionic serve/writing a bad server.js file
