Ionic Starter App missing main.js


#1

Hi,

I installed today NodeJs. from scratch then installed Ionic and Cordova:
npm install -g cordova ionic

It went fine, no errors.Now my versions are:
global packages:

@ionic/cli-utils : 1.2.0
Ionic CLI        : 3.2.0

System:

Node       : v6.10.3
OS         : Windows 7
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

Then I tried to start a new app with blank(or sidemenu) template. Which started with no errors.

Now when i run ionic serve, i get no errors in console, but i get only a blank app in browser stating the main.js is missing.
Indeed the file is not in www\bild, neither the map for main.js.

What i tried:

  • Different version of node js (6.10.3 and 6.7.0 with nvm-windowds)
  • Uninstall and delete the whole thing
  • Use windows command line instead of gitbash
  • Google the answer for a few hours

The question is: What else could i try? What could be the issue?

UPDATE

This is the start:

user@user-PC MINGW64 /e/!EPApp
$ ionic start asd blank
:heavy_check_mark: Creating directory .\asd - done!
[INFO] Fetching app base (https://github.com/driftyco/ionic2-app-base/archive/master.tar.gz)
:heavy_check_mark: Downloading - done!
[INFO] Fetching starter template blank (https://github.com/driftyco/ionic2-starter-blank/archive/master.tar.gz)
:heavy_check_mark: Downloading - done!
:heavy_check_mark: Updating package.json with app details - done!
:heavy_check_mark: Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!

npm install
:heavy_check_mark: Running command - done!
npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest
:heavy_check_mark: Running command - done!
git init
:heavy_check_mark: Running command - done!
git add -A
:heavy_check_mark: Running command - done!
git commit -m Initial commit
:heavy_check_mark: Running command - done!

♬ β™« ♬ β™« Your Ionic app is ready to go! ♬ β™« ♬ β™«

Run your app in the browser (great for initial development):
ionic serve

Run on a device or simulator:
ionic cordova run ios

Test and share your app on a device with the Ionic View app:
http://view.ionic.io

? Link this app to your Ionic Dashboard to use tools like Ionic View? (Y/n) n
? Link this app to your Ionic Dashboard to use tools like Ionic View? No

Go to your newly created project: cd .\asd

Ionic info in project:

$ ionic info

global packages:

@ionic/cli-utils : 1.2.0
Ionic CLI        : 3.2.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-ionic-angular : 1.2.0
Ionic Framework                 : ionic-angular 3.2.1

System:

Node       : v6.10.3
OS         : Windows 7
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

Ionic serve:

Shows a blank page in the browser and writes this into the console:
Failed to load resource: the server responded with a status of 404 (Not Found) main.js

Ionic Serve:

$ ionic serve -lab
[INFO] Starting app-scripts server: --nobrowser --b --lab --l --a --port 8100 – p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to cancel
[16:12:12] watch started …
[16:12:12] build dev started …
[16:12:12] clean started …
[16:12:12] clean finished in 2 ms
[16:12:12] copy started …
[16:12:12] transpile started …
[16:12:15] transpile finished in 3.65 s
[16:12:15] preprocess started …
[16:12:15] deeplinks started …
[16:12:15] deeplinks finished in 25 ms
[16:12:15] preprocess finished in 25 ms
[16:12:16] webpack started …
[16:12:16] webpack finished in 235 ms
[16:12:16] sass started …
[16:12:16] copy finished in 3.93 s
[16:12:16] sass finished in 290 ms
[16:12:16] postprocess started …
[16:12:16] postprocess finished in 8 ms
[16:12:16] lint started …
[16:12:16] build dev finished in 4.25 s
[16:12:16] watch ready in 4.36 s
[16:12:16] dev server running: http://localhost:8100/

[16:12:20] lint finished in 3.58 s

npm build runs without output and nothing seems to change.


#2

What exact command are you using to start the app?
What is the ionic info output in your created project folder?
What exactly does ionic serve output?
Try running npm run build there and tell us what happens.


#3

Updated the question.


#4

Something is strange on your system.

I just tried to reproduce this:

PS C:\Users\Jan\Documents> ionic info
[WARN] You are not in an Ionic project directory. Project context may be missing.

global packages:

    @ionic/cli-utils : 1.2.0
    Ionic CLI        : 3.2.0

System:

    Node       : v6.10.3
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

PS C:\Users\Jan\Documents> ionic start asd blank
βœ” Creating directory .\asd - done!
[INFO] Fetching app base (https://github.com/driftyco/ionic2-app-base/archive/master.tar.gz)
βœ” Downloading - done!
[INFO] Fetching starter template blank (https://github.com/driftyco/ionic2-starter-blank/archive/master.tar.gz)
βœ” Downloading - done!
βœ” Updating package.json with app details - done!
βœ” Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!
> npm install
βœ” Running command - done!
> npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest
βœ” Running command - done!
> git init
βœ” Running command - done!
> git add -A
βœ” Running command - done!
> git commit -m Initial commit
βœ” Running command - done!

♬ β™« ♬ β™«  Your Ionic app is ready to go! ♬ β™« ♬ β™«

Run your app in the browser (great for initial development):
  ionic serve

Run on a device or simulator:
  ionic cordova run ios

Test and share your app on a device with the Ionic View app:
  http://view.ionic.io

? Link this app to your Ionic Dashboard to use tools like Ionic View? No

Go to your newly created project: cd .\asd
PS C:\Users\Jan\Documents> cd .\asd\
PS C:\Users\Jan\Documents\asd> ionic info

global packages:

    @ionic/cli-utils : 1.2.0
    Ionic CLI        : 3.2.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-ionic-angular : 1.2.0
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v6.10.3
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

PS C:\Users\Jan\Documents\asd> ionic serve
[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to
 cancel
[19:27:04]  watch started ...
[19:27:04]  build dev started ...
[19:27:04]  clean started ...
[19:27:04]  clean finished in 3 ms
[19:27:04]  copy started ...
[19:27:04]  transpile started ...
[19:27:09]  transpile finished in 4.35 s
[19:27:09]  preprocess started ...
[19:27:09]  deeplinks started ...
[19:27:09]  deeplinks finished in 18 ms
[19:27:09]  preprocess finished in 21 ms
[19:27:09]  webpack started ...
[19:27:09]  copy finished in 4.83 s
[19:27:24]  webpack finished in 15.00 s
[19:27:24]  sass started ...
[19:27:25]  sass finished in 1.65 s
[19:27:25]  postprocess started ...
[19:27:25]  postprocess finished in 32 ms
[19:27:25]  lint started ...
[19:27:25]  build dev finished in 21.12 s
[19:27:25]  watch ready in 21.27 s
[19:27:25]  dev server running: http://localhost:8100/

[19:27:31]  lint finished in 5.43 s

Browser opened with the expected β€œIonic Blank” template.

Same for -lab by the way:

PS C:\Users\Jan\Documents\asd> ionic serve -lab
[INFO] Starting app-scripts server: --nobrowser --b --lab --l --a --port 8100 --p 8100 --livereload-port 35729 --r 35729
 --address 0.0.0.0 - Ctrl+C to cancel
[19:29:43]  watch started ...
[19:29:43]  build dev started ...
[19:29:43]  clean started ...
[19:29:43]  clean finished in 21 ms
[19:29:43]  copy started ...
[19:29:43]  transpile started ...
[19:29:50]  transpile finished in 6.80 s
[19:29:50]  preprocess started ...
[19:29:50]  deeplinks started ...
[19:29:50]  deeplinks finished in 40 ms
[19:29:50]  preprocess finished in 44 ms
[19:29:50]  webpack started ...
[19:29:51]  copy finished in 7.61 s
[19:30:13]  webpack finished in 23.46 s
[19:30:13]  sass started ...
[19:30:15]  sass finished in 1.80 s
[19:30:15]  postprocess started ...
[19:30:15]  postprocess finished in 7 ms
[19:30:15]  lint started ...
[19:30:15]  build dev finished in 32.23 s
[19:30:15]  watch ready in 32.38 s
[19:30:15]  dev server running: http://localhost:8100/

[19:30:21]  lint finished in 5.96 s

#5

Reproduced the whole thing in a VM on my PC. It works. Something gonna be with my system then.
Thanks for the help!

UPDATE:

The issue was not with ionic itself. The issue what with webpack. I had an ! in my folder name. Once i removed the !, it worked perfectly.


#6

Whoah, what a strange thing!