mastilver / dynamic-cdn-webpack-plugin

Get your dependencies from a cdn rather than bundling them in your app
MIT License
343 stars 37 forks source link

UnhandledPromiseRejectionWarning: Error: Invalid name: "redux-saga/effects" #32

Closed aulisius closed 7 years ago

aulisius commented 7 years ago

Getting this error, when trying to include this plugin into my webpack config.

aulisius commented 7 years ago

Fixed this currently by using the only option passed to the plugin, but should the plugin break when it can't resolve a package?

mastilver commented 7 years ago

should the plugin break when it can't resolve a package?

No, it shouldn't... it should just ignore it... :/

I will need to have a look at that later

aulisius commented 7 years ago

I believe adding a .catch block here should at least prevent the plugin from dying.

mastilver commented 7 years ago

Can you give me the full stack trace?

Did you install redux-saga?

aulisius commented 7 years ago

This is when I run without using the only option.

(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Invalid name: "redux-saga/effects"
(node:13924) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, prom
ise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 10): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 12): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 14): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 16): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 18): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 20): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 22): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 24): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 26): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 28): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 31): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 34): Error: Invalid name: "redux-saga/effects"
Node#moveTo was deprecated. Use Container#append.
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 36): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 39): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 41): Error: Invalid name: "redux-saga/effects"
(node:13924) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 43): Error: Invalid name: "redux-saga/effects"

And yes, I have installed redux-saga

mastilver commented 7 years ago

It reminds me of this issue: https://github.com/benmosher/eslint-plugin-import/issues/793

Is it working at all with redux-saga@0.14.4?

aulisius commented 7 years ago

I didn't get that error with redux-saga@0.14.4.

mastilver commented 7 years ago

That's it then! :)

Easier to write a test with that information! There is a good chance, it's due to an underlying dependency (I have no idea which one yet). Maybe https://github.com/sindresorhus/resolve-pkg or https://github.com/sindresorhus/read-pkg-up

mastilver commented 7 years ago

For reference: the issue is caused by this change in redux-saga: https://github.com/redux-saga/redux-saga/pull/895

mastilver commented 7 years ago

I found where the error comes from: https://github.com/npm/normalize-package-data/blob/9948ecf3d97cffcaab8f914522a0f3953edac6e4/lib/fixer.js#L335

mastilver commented 7 years ago

fixed on v3.4.1

aulisius commented 7 years ago

Awesome. Thanks a lot 💯