Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Receive "UnhandledPromiseRejectionWarning" error in ionic serve #590

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

Receive "UnhandledPromiseRejectionWarning" error in ionic serve #590

codisms opened this issue Dec 20, 2016 · 16 comments

Comments

@codisms
Copy link

codisms commented Dec 20, 2016

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Short description of the problem:

After running ionic serve, when modifying a file, I receive a UnhandledPromiseRejectionWarning error.

What behavior are you expecting?

The change should be detected, any SASS or TypeScript files should be recompiled, and the page reloaded (if livereload is active).

Steps to reproduce:

  1. Run ionic serve on a working project.
  2. Edit a SCSS or TS file and save.

Which @ionic/app-scripts version are you using?
0.0.48

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Full output:

> ionic-hello-world@ ionic:serve /root/.../.../...
> ionic-app-scripts serve "--port" "9002" "--livereload-port" "9003" "--nobrowser" "--address" "165.x.x.66" "--lab" "--serverlogs"

[17:23:35]  ionic-app-scripts 0.0.48
[17:23:35]  watch started ...
[17:23:35]  build dev started ...
[17:23:35]  clean started ...
[17:23:35]  clean finished in 9 ms
[17:23:35]  copy started ...
[17:23:35]  transpile started ...
[17:23:45]  transpile finished in 10.30 s
[17:23:45]  webpack started ...
[17:23:46]  copy finished in 10.64 s
[17:24:13]  webpack finished in 27.67 s
[17:24:13]  sass started ...
[17:24:15]  sass finished in 1.81 s
[17:24:15]  build dev finished in 39.87 s
[17:24:15]  watch ready in 40.12 s
[17:24:15]  dev server running: http://165.x.x.x:9002/

[17:24:31]  build started ...
(node:13998) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'send' of undefined
@fiznool
Copy link
Contributor

fiznool commented Dec 21, 2016

I'm seeing this too. It makes the current version of app-scripts unusable, as the build does not complete. It happens to me after the first time I save a file.

@codisms
Copy link
Author

codisms commented Dec 22, 2016

This seems to come and go. Now it's working, but it wasn't earlier today.

@thinktinker
Copy link

@codisms, are you writing on a new blank ionic project? What does your ionic info look like? Mine isn't solved yet. =(

@codisms
Copy link
Author

codisms commented Dec 22, 2016

No, it's not blank, and I didn't do anything for it to have changed. It just started working. Will comment should it stop again, but I wouldn't consider it closed.

@gust42
Copy link
Contributor

gust42 commented Dec 23, 2016

I dont know if its releted but ive seen this a couple of times when starting a ionic serve -b and changing a file before i have refreshed a existing browser tab to connect it to a new serve.

@b264
Copy link

b264 commented Dec 24, 2016

I see this too on version 0.0.48 and I also get Mixed Content: The page at 'https://3ZzLYsgk.ngrok.io/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://3ZzLYsgk.ngrok.io:53703/'. This request has been blocked; this endpoint must be available over WSS. everytime I use it because I'm using https and I don't know how to change the ionic websocket endpoint. So maybe this UnhandledPromiseRejectionWarning error could in fact be caused by a websocket problem

@gregemerson
Copy link

gregemerson commented Dec 26, 2016

I am also getting this when doing "ionic build browser" using:

ordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.47
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.2
Xcode version: Not installed

Build output:

ionic-hello-world@ ionic:build C:\Bitnami\wampstack-5.6.22-0\apps\sc-metronome
ionic-app-scripts build

keywords if/then/else require v5 option
[17:24:12] ionic-app-scripts 0.0.47
[17:24:12] build dev started ...
[17:24:12] clean started ...
[17:24:12] clean finished in 23 ms
[17:24:12] copy started ...
[17:24:12] transpile started ...
[17:24:26] transpile finished in 14.55 s
[17:24:26] webpack started ...
[17:24:27] copy finished in 15.17 s
(node:1872) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'content' of null
Error loading cordova-browser

Running command: cmd "/s /c "C:\Bitnami\wampstack-5.6.22-0\apps\sc-metronome\platforms\browser\cordova\build.bat""

Cleaning Browser project

@fiznool
Copy link
Contributor

fiznool commented Jan 4, 2017

Figured this one out, thanks to some comments in #599.

This happens to me when I don't have a browser open with the app loaded. PR submitted which fixes the issue.

@b264
Copy link

b264 commented Jan 4, 2017

#616

@danbucholtz
Copy link
Contributor

This should be fixed now. Will be published tomorrow in 0.0.49.

Please let me know if it's not.

Thanks,
Dan

@codetoaj
Copy link

"npm update" may solve this problem

@ish3lan
Copy link

ish3lan commented Aug 11, 2017

I got this error now,

  1. copied the whole repo directory to another directory (V2)
  2. cd V2
  3. git checkout -b V2.0 remote/V2.0
  4. npm update
  5. ionic cordova build ios

some output then

(node:67507) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed

@jgfet
Copy link

jgfet commented Sep 12, 2017

I'm also getting this with ionic update after ionic config set -g backend legacy. Can't seem to get my app to work in ionic view any more either. @ionic/app-scripts : 2.1.4. I think the ionic config logged me out of the normal app.ionic.io account. As soon as I logged back in and did ionic link it worked. System to upload yesterday was flaky. Could not get anything working with new pro or old system.

@gtzinos
Copy link

gtzinos commented Sep 24, 2017

Hello guys, i had the same issue and i fixed it with these commands:

  1. rm -rf ./node_modules
  2. npm install
  3. ionic cordova rm android && ionic cordova add android

@senges
Copy link

senges commented Aug 23, 2018

Worked for me :

  1. rm -rf ./node_modules
  2. npm install --no-optional --no-shrinkwrap --no-package-lock
  3. ionic serve

@anastasialela
Copy link

Hello guys, i had the same issue and i fixed it with these commands:

  1. rm -rf ./node_modules
  2. npm install
  3. ionic cordova rm android && ionic cordova add android

this command worked for me, Thank you

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