Skip to content
This repository was archived by the owner on Nov 20, 2019. It is now read-only.

Unhandled promise rejection #29

Closed
Khachatour opened this issue May 6, 2017 · 10 comments
Closed

Unhandled promise rejection #29

Khachatour opened this issue May 6, 2017 · 10 comments
Labels

Comments

@Khachatour
Copy link

When I am using this plugin, I keep getting

(node:29634) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): undefined
Can someone suggest an answer ?

@Khachatour
Copy link
Author

I already fixed it, it cause by wrong webpack configuration, thanks!

@oliviertassinari
Copy link
Owner

@Khachatour So it's not on our side?

@Khachatour
Copy link
Author

@oliviertassinari 100% no, But can you specify in error handling that it is from webpack. It took me a day to resolve that :) . For example to say that it comes from webpack configs ?

@oliviertassinari
Copy link
Owner

Do you have a reproduction example so I can have a look at?

@anthonator
Copy link

I'm running into this as well. @Khachatour could you post the solution?

@Khachatour
Copy link
Author

@oliviertassinari Now I can't reproduce it, I am sure it came form my side. But I will try to reproduce that as soon as possible.
@anthonator As I mentioned I can't reproduce it, but as I remember it was coming form wrong configuration for service worker, are you creating sw file by your own ? I will try to reproduce that as soon as possible and return here with exact solution ok?

@oliviertassinari
Copy link
Owner

No rush, let us know if you find something :).

@Khachatour
Copy link
Author

@oliviertassinari I've reproduced the error, It comes when in your webpack dev configs you declare the usage of service worker plugin and then in plugins section declare the usage of plugin with this code below:
new ServiceWorkerWebpackPlugin({ entry: path.join(__dirname, 'src/sw.js'), })
The error UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): undefined shows up. I think its when your declared path src/sw.js is not in the webpack output assets in development environment, or simply not correct path as I think. What you think ?
@anthonator Here it is!! :)

@anthonator
Copy link

The issue I was having was definitely an issue with my entry file not being found. I had a typo. I think this is just an issue of better error handing/reporting.

@Khachatour
Copy link
Author

@anthonator I definitely agree with you. The error shown is not giving a clue what was wrong :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants