Unable to create main.css and vendor.js in build folder

I am very new to angular and ionic.

I am having serious trouble and couldn’t find a solution online.

My ionic app is not generating any main.css and vendor.ts when I run ionic serve command and simply display a blank page and console shows the following error:

Ionic%20error

Refused to apply style from ‘http://localhost:8100/build/main.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
(index):46 GET http://localhost:8100/build/vendor.js net::ERR_ABORTED 404 (Not Found)
(index):54 GET http://localhost:8100/build/main.js net::ERR_ABORTED 404 (Not Found)
(index):1 Refused to apply style from ‘http://localhost:8100/build/main.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
(index):46 GET http://localhost:8100/build/vendor.js net::ERR_ABORTED 404 (Not Found)
(index):54 GET http://localhost:8100/build/main.js net::ERR_ABORTED 404 (Not Found)
(index):1 Error while trying to use the following icon from the Manifest: http://localhost:8100/assets/imgs/logo.png (Resource size is not correct - typo in the Manifest?)
ion-dev.js?v=3.2.3:121 Dev server logger closed
19livereload.js?snipver=1:76 WebSocket connection to ‘ws://localhost:35729/livereload’ failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

ionic info:

Ionic:

ionic (Ionic CLI) : 4.12.0
Ionic Framework : ionic-angular 3.9.5
@ionic/app-scripts : 3.2.3

Cordova:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 8 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Users\Pankaj\AppData\Local\Android\Sdk)
NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10

Any Solution to this i am having the same problem after upgrading windows10

I did the following to make it work

  1. Delete your node_modules folder
  2. Run the following commands from cmd inside your project folder
    a) npm install
    b) npm rebuild node-sass

Let me know if that works

1 Like