Ionic serve generates missing file(s) or missing file names


#1

Hello ,

I’ve just tried to generate new ionic app ( i tried blank, sidenav and tabs ) but i’m getting really interesting error. This is my www folder after running ionic serve command

Directory: E:\Coding\İonic\cutePuppyPics\www

Mode LastWriteTime Length Name


d----- 11.06.2017 03:57 assets
d----- 11.06.2017 03:57 build
-a---- 11.06.2017 03:53 0 .gitkeep
-a---- 11.06.2017 03:57 266 anifest.json
-a---- 11.06.2017 03:57 715 ervice-worker.js
-a---- 11.06.2017 03:53 207 manifest.json
-a---- 11.06.2017 03:57 1276 ndex.html
-a---- 11.06.2017 03:53 168 service-worker.js

If you noticed there is no index.html. It is ndex.html (there is no ‘i’ ) so i’m getting this error ;

var contentStr = content.toString();
                        ^

TypeError: Cannot read property ‘toString’ of undefined
at Object.injectLiveReloadScript (E:\Coding\İonic\cutePuppyPics\node_modules@ionic\app-scripts\dist\dev-server\live-reload.js:28:29)
at ReadFileContext.callback (E:\Coding\İonic\cutePuppyPics\node_modules@ionic\app-scripts\dist\dev-server\http-server.js:69:39)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:358:13)

I tried this but it didnt solve my problem.;

If i rename ndex.html to index.html this error gets fixed but i get another error;

[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to cancel
[04:03:14] watch started …
[04:03:14] build dev started …
[04:03:14] clean started …
[04:03:14] clean finished in 4 ms
[04:03:14] copy started …
[04:03:14] transpile started …
[04:03:16] transpile finished in 2.33 s
[04:03:16] preprocess started …
[04:03:16] deeplinks started …
[04:03:16] deeplinks finished in 18 ms
[04:03:16] preprocess finished in 19 ms
[04:03:16] webpack started …
[04:03:16] copy finished in 2.49 s
[04:03:22] webpack finished in 6.22 s
[04:03:22] sass started …
[04:03:23] sass finished in 826 ms
[04:03:23] postprocess started …
[04:03:23] postprocess finished in 5 ms
[04:03:23] lint started …
[04:03:23] build dev finished in 9.44 s
[04:03:25] lint finished in 1.92 s
[04:03:26] dev server running: http://localhost:8100/

[ERROR] app-scripts serve unexpectedly failed.settings: undefinedcontext: [object Object]

I tried to reinstall ionic and cordova but it didnt solved as well.

Any ideas ?


#2

What command are you running to build the app?
Add --verbose at the end of that command and show us the output.
Also show us the output of ionic info please.


#3

I just followed steps on ionic getting started. So i didnt use any build command as far as i know

PS E:\Coding\İonic\testApp> ionic info
global packages:

@ionic/cli-utils : 1.3.0
Ionic CLI        : 3.3.0

local packages:

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

System:

Node       : v7.7.0
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

PS E:\Coding\İonic\testApp> ionic serve --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] Getting plugin info for ionic
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.
[DEBUG] Latest version of ionic@latest is 3.3.0.
[DEBUG] Latest version of @ionic/cli-plugin-ionic-angular@latest is 1.3.0.
[INFO] Starting app-scripts server: --log-level debug --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to cancel
[15:50:44] watch started …
[15:50:44] build dev started …
[15:50:44] clean started …
[15:50:44] clean finished in 40 ms
[15:50:44] copy started …
[15:50:44] transpile started …
[15:50:52] transpile finished in 7.32 s
[15:50:52] preprocess started …
[15:50:52] deeplinks started …
[15:50:52] deeplinks finished in 7 ms
[15:50:52] preprocess finished in 8 ms
[15:50:52] webpack started …
[15:50:52] copy finished in 8.23 s
[15:51:00] webpack finished in 8.75 s
[15:51:00] sass started …
[15:51:02] sass finished in 2.03 s
[15:51:02] postprocess started …
[15:51:02] postprocess finished in 24 ms
[15:51:02] lint started …
[15:51:02] build dev finished in 18.23 s
[15:51:05] lint finished in 2.34 s
[15:51:05] dev server running: http://localhost:8100/

[DEBUG] !!! ERROR ENCOUNTERED !!!
[ERROR] app-scripts serve unexpectedly failed.settings: undefinedcontext: [object Object]


#4

ionic serve is building the app in the background.

Super strange error…

Could you try another Node version v6.x maybe?


#5

Or before you change node, try running serve via npm run ionic:serve.

(via https://github.com/ionic-team/ionic-app-scripts/issues/1002 which seems relevant)


#6

PS E:\Coding\İonic\testApp> npm run ionic:serve

testApp@0.0.1 ionic:serve E:\Coding\İonic\testApp
ionic-app-scripts serve

module.js:471
throw err;
^

Error: Cannot find module 'E:\Coding\İonic\testApp\node_modules.bin…@ionic\app-scripts\bin\ionic-app-scripts.js’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testApp@0.0.1 ionic:serve: ionic-app-scripts serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testApp@0.0.1 ionic:serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\omerf\AppData\Roaming\npm-cache_logs\2017-06-11T13_44_17_634Z-debug.log

PS E:\Coding\İonic\testApp> nvm use 6.11
6.11.0
Now using node v6.11.0 (64-bit)
PS E:\Coding\İonic\testApp> ionic serve
Error: Missing binding E:\Coding\İonic\testApp\node_modules\node-sass\vendor\win32-x64-48\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x

Found bindings for the following environments:

  • Windows 64-bit with Node.js 7.x

This usually happens because your environment has changed since running npm install.
Run npm rebuild node-sass to build the binding for your current environment.

I runned npm rebuild node-saas but nothing changed.


#7
  1. Try an older version, 6.10 or something.
  2. Just noticed the path of your project: “İonic”. Try generating a new project in a folder with a less strange name like e.g. “Ionic”.

#8

Ok solved my problem, it is about folder name as you mentioned at two. İ tried with node 7.7.0 and it worked too. It is all about that ‘İ’ letter…

Thanks @Sujan12 .


#9

Great that it worked!

Could you please open an issue at https://github.com/ionic-team/ionic-cli/issues about this? I don’t think this should stay this way. (Post the link here when you did so I can track it too)


#10

OK, I’m opening right now, i opened a issue at here but i’ve just closed it https://github.com/ionic-team/ionic-app-scripts/issues/1035

I will open issue where you say in a minute, Thanks for help again ^^


#11

Actually, app-scripts would have been fine.


#12

reopened. i’m leaving both open. Ionic team will decide what to do i suppose.