Cannot serve app in localhost with ionic serve (blank page)


#1

hi guys i was working on a app for 2 months, its never been before. today i typed ionic serve and it gave me a blank page. i tried again again again; nothing changed.

the errors of console is like that:

Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.css Failed to load resource: the server responded with a status of 404 (Not Found)

then i searched for solution on the internet and tried that:

npm uninstall -g cordova ionic
npm install -g cordova ionic

but it didnt work!

so i remembered, once i backed up my app folder before. so i tried that and saw it works. i copied that back-up folder’s www/build folder files to the my up to date app-folder. and run ionic serve again. it deletes all files automatically and doesnt work?

i cannot serve my app ? please assist me guys. i did nothing to receive that error i am shocked!

terminal:

Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser -
Ctrl+C to cancel
[04:35:39]  watch started ...
[04:35:39]  build dev started ...
[04:35:39]  clean started ...
[04:35:39]  clean finished in 7 ms
[04:35:39]  copy started ...
[04:35:39]  deeplinks started ...
[04:35:39]  deeplinks finished in 236 ms
[04:35:39]  transpile started ...
[04:35:43]  dev server running: http://localhost:8100/

[OK] Development server running!
     Local: http://localhost:8100
     External: http://192.168.1.3:8100, http://192.168.136.1:8100, http://192.168.80.1:8100
     DevApp: DenemeApp@8100 on ASUS

[04:35:44]  copy finished in 4.77 s
[04:35:44]  watch ready in 4.94 s

stops here.

my ionic info:


cli packages: (C:\Users\Uğur\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.8.0

System:

    Node : v6.11.4
    npm  : 3.10.10
    OS   : Windows 8.1

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

#2

Hi, have you tried to clean the cookie/ cache of your browser?


#3

yes i tried that, also i tried in different browsers its not about cache or cookie. main.js vendor.js main.css files are corrupted or something. and i dont know why this happened and how to fix this.


#4

Try ‘npm install’ in the project folder


#5

tried didnt work mate


#6

you might want to re-install your node. Perhaps it’s because of the update?


#7

tried re-install node to current LTS (8.9.3). Didnt work.
Anybody have luck?


#8

Ok I “fix” it by revert from repository to last revision and it worked! Then I implemented same functionality and it still worked (maybe little bit different way).
Maybe it could be something with typescript because it not compiled all TS code. Some syntax error that’s not be highlight right because when I run Ionic build, it show me internal typescript error without link to my code.