Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Ionic serve failed to load (typescript 0.0.47 and 0.0.48) #9723

Closed
thinktinker opened this issue Dec 20, 2016 · 16 comments
Closed

Bug: Ionic serve failed to load (typescript 0.0.47 and 0.0.48) #9723

thinktinker opened this issue Dec 20, 2016 · 16 comments

Comments

@thinktinker
Copy link

Everytime I save a page, the page does not refresh in the web browser (ionic serve -all)

Looking at my terminal console, I get the following error.

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): TypeError: Cannot read property 'send' of undefined

I'm using ionic 2.1.8 (typescript 0.0.47), node 6.9.1, running on ubuntu 16.04.

@thinktinker thinktinker changed the title Ionic serve failed to load Bug: Ionic serve failed to load (typescript 0.0.47) Dec 20, 2016
@AndreasGassmann
Copy link
Contributor

It looks like you have an unhandled promise rejection in your code. Try looking for the usage of the .send function and see if you are missing a .catch(console.log) on that promise.

@thinktinker
Copy link
Author

thinktinker commented Dec 20, 2016

It was a fresh project downloaded (ionic start myApp blank --v2 --ts), and the only thing I changed was the home.html file with some basic text.

What I observed is that current fresh 'blank' projects loaded uses the (0.0.47 typescript), which all this while whenever I download a new project previously, the console prompts me I'm using 0.0.45 typescript, which runs perfectly well on my current install of ionic CLI 2.1.8, with nodejs 6.9.1.

Could it be possible that the starter files using typesript 0.0.47 on the repo has bugs or are broken, or incompatible with my current ionic + nodejs install?

Appreciate further advise here. Thank you.

@jayeshanandani
Copy link

Could you please update to ionic-app-scripts version 0.0.48 and probably also share ionic info output.

@thinktinker
Copy link
Author

thinktinker commented Dec 20, 2016

The problem persists though I installed the latest app-script (0.0.48). When I update home.html, the error in bold further below shows up. Any advise?

My ionic info

Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
Ionic App Scripts Version: 0.0.48
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.9.1
Xcode version: Not installed

When I run ionic serve and update home.html

ionic-hello-world@ ionic:serve /build/myapp
ionic-app-scripts serve

[18:12:30] ionic-app-scripts 0.0.48
[18:12:34] watch started ...
[18:12:34] build dev started ...
[18:12:34] clean started ...
[18:12:34] clean finished in 35 ms
[18:12:34] copy started ...
[18:12:34] transpile started ...
[18:13:03] transpile finished in 28.44 s
[18:13:03] webpack started ...
[18:13:04] copy finished in 29.49 s
[18:13:15] webpack finished in 12.10 s
[18:13:15] sass started ...
[18:13:17] sass finished in 2.72 s
[18:13:17] build dev finished in 43.37 s
[18:13:18] watch ready in 43.65 s
[18:13:18] dev server running: http://localhost:8100/

[18:14:03] build started ...
(node:67) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'send' of undefined

@jayeshanandani
Copy link

jayeshanandani commented Dec 20, 2016

Which version of typescript are you using? Also please ensure you have latest ionic cli installed.

npm install -g ionic@latest

@thinktinker
Copy link
Author

thinktinker commented Dec 20, 2016

Within my package.json dependencies, it states "typescript": "2.0.9".
I'm practically working on brand new 'blank project', and only started inputing some text in the home.html file.
What is the current version of CLI now? My info says I'm using Ionic CLI Version: 2.1.8.
Does either of the above two break the ionic serve process?

@thinktinker thinktinker changed the title Bug: Ionic serve failed to load (typescript 0.0.47) Bug: Ionic serve failed to load (typescript 0.0.47 and 0.0.48) Dec 20, 2016
@thinktinker
Copy link
Author

thinktinker commented Dec 20, 2016

Now everything just broke Having done the following:

  1. npm install @ionic/app-scripts@latest
  2. npm install -g ionic/latest

Nothing compiles now, with the below output error:
There was an error serving your Ionic application: Error: Cannot find module 'cross-spawn-async'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.runIonicScript (/usr/lib/node_modules/ionic/lib/utils/npmScripts.js:22:15)
at /usr/lib/node_modules/ionic/lib/ionic/serve.js:71:27
at _fulfilled (/usr/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/lib/node_modules/ionic/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/lib/node_modules/ionic/node_modules/q/q.js:557:44

@jayeshanandani
Copy link

@thinktinker : seems like your ionic latest update was not installed successfully. Please try running command npm install -g ionic@latest and ensure it runs fully. Also delete node_modules from project folder and re-run npm install in project.

@thinktinker
Copy link
Author

thinktinker commented Dec 21, 2016

Have been doing this for one whole night.
I'm certain that the new blank starter projects have dependencies that do not work with my current ionic set up - which is an older set up (below). It's a shame. Shouldn't there be some backward compatibility of the starter projects with previous RCs of ionic 2?
This is my current set up
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
Ionic App Scripts Version: 0.0.48
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.9.1
Xcode version: Not installed

@jgw96
Copy link
Contributor

jgw96 commented Dec 21, 2016

This issue was moved to ionic-team/ionic-app-scripts#599

@jgw96 jgw96 closed this as completed Dec 21, 2016
@thinktinker
Copy link
Author

thinktinker commented Dec 21, 2016

Hi jgw96. Is this issue fixed?

@jgw96
Copy link
Contributor

jgw96 commented Dec 21, 2016

Hello @thinktinker . So I closed this issue and moved it to the app-scripts repo which you can see the link to in my above comment. The reason for this move was because this issue is actually an app-scripts issue and not a framework issue.

@thinktinker
Copy link
Author

thinktinker commented Dec 21, 2016

Thanks for the heads up @jgw96.
Is there a way for me to download a 'blank' project based on 0.0.45 whenever I call 'ionic start myapp blank --v2 --ts'?
Current requests of such serves me a 0.0.47 typescript which breaks in my current ionic development environment.

@walkingWind
Copy link

I have the same issue.My @ionic/app-scripts version is 0.0.47. So,could you tell me how to change my @ionic/app-scripts version to 0.0.45

@walkingWind
Copy link

I have found my issue. I had changed the structure of directory when I add android platform. I had rename index.htm to main.html, and add another index.html.So,change it back.The ionic serve work well.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 4, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants