Sometimes main.js and main.css is giving 404 error, so app won’t start…
without any changes if I serve again it’s working fine, this happening randomly.
Failed to load resource: the server responded with a status of 404 (Not Found)
2 http://localhost:8100/build/main.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8100/build/main.css Failed to load resource: the server responded with a status of 404 (Not Found)
tag_assistant_compiled.js:117 GET http://localhost:8100/build/main.js 404 (Not Found)
No there is no any error in terminal, it’s happen randomly… I notice following things
If I run serve command again without any changes it’s works fine, and sometime it’s don’t then I have to quite server and try again 2-3 times without any changes then it’s start working again.
while server sometime it’s giving 404 error in browser console for main.js and main.css
browser is not being refresh many times, I have to refresh manually from terminal.,
sometimes I am getting following error
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm ERR!
Failed at the ionic-hello-world@ watch script ‘ionic-app-scripts watch’.
npm ERR!
Make sure you have the latest version of node.js and npm installed.
npm
ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm
ERR! not with npm itself.
npm
ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts watch
npm ERR!
You can get information on how to open an issue for this project with:
npm ERR!
npm bugs ionic-hello-world
npm ERR!
Or if that isn’t available, you can get their info via:
npm
ERR! npm owner ls ionic-hello-world
npm
ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!
H:\xampp\htdocs\MyAppIO2RC0\MyApp\npm-debug.log
Following is npm-debug.log
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm
ERR!
Windows_NT 10.0.14393
npm
ERR!
argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm
ERR! node v6.2.0
npm
ERR! npm
v3.8.9
npm ERR!
code ELIFECYCLE
npm
ERR! ionic-hello-world@ watch: `ionic-app-scripts watch`
npm
ERR! Exit status 3
npm ERR!
npm ERR!
Failed at the ionic-hello-world@ watch script 'ionic-app-scripts watch'.
npm ERR!
Make sure you have the latest version of node.js and npm installed.
npm
ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm
ERR! not with npm itself.
npm
ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts watch
npm ERR!
You can get information on how to open an issue for this project with:
npm ERR!
npm bugs ionic-hello-world
npm ERR!
Or if that isn't available, you can get their info via:
npm
ERR! npm owner ls ionic-hello-world
npm
ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!
H:\xampp\htdocs\MyAppIO2RC0\MyApp\npm-debug.log
If above thing happen I have to quite server and run serve again then again it’s start working
I never face such issue with Beta 11 this only happening in RC0
@jigsaxis The build is fine I check that if there are any errors in the code the the ionic-server will run any way…but when you build or run the linter will not allow to create the main.js…So the problem is in the code and not with ionic CLI
To reiterate what @mhartington said, make sure to check your build console carefully. There are some libraries and code constructs that are treated very differently by the dev and prod build systems, and it is very possible that you are doing something that is accepted by dev mode but rejected by prod.
Have the same problem…404 errors out of sudden. When I have a 404 all builds also fail (same cli error as jigsaxis). But normally it doesn’t go away. I have to manually copy my code to a new project, to make it work again. Slows down productivity a lot
Having the same issue on Windows 10. > ionic build always builds main.js, but > ionic serve deletes and then doesn’t re-create it. Clean console output. Really slowing me down…
I’m getting these errors while going through this great tut.
I get main.js and main.css not found in the console while running ionic serve.
I’m on Mac OSX 10.10.5/Chrome 53 using the latest Ionic 2.
The sample code runs without these errors. However, going through the tutorial step by step, after step 3, running ionic serve the app is broken with those errors in the console.
This also happened to me. I figured it out that it’s when I import my own npm package via import {myStuff} from 'myStuffJs'; it silently shows similar error at browser’s console but not during ionic serve.
But after I changed code back to normal way using <script src='myStuffJs.min.js> and in.tssource file, I dodeclare var myStuff: any;`, it has no problem.
I got same problem.
Ionic serve was working fine.
15 minutes later, try to run ionic serve again and got the message on console:
http://localhost:8100/build/main.css Failed to load resource: the server responded with a status of 404 (Not Found) 2http://localhost:8100/build/main.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8100/build/main.css Failed to load resource: the server responded with a status of 404 (Not Found)
I have the same issue in Ionic 3 after I install cordova-plugin-market. The ‘run’ command succeeds but the build folder only contains two files. I’ve logged this as the following bug:
BUILD SUCCESSFUL
Total time: 25.622 secs
Built the following apk(s):
..../platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=~/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Skipping build...
Built the following apk(s):
..../platforms/android/build/outputs/apk/android-debug.apk
Using apk: ..../platforms/android/build/outputs/apk/android-debug.apk
Package name: com.blah.blah
LAUNCH SUCCESS
The build folder is virtually empty
/www/build
polyfills.js
sw-toolbox.js
If I remove cordova-plugin-market, the /www/build looks correct: