我正在尝试使用 Fitbit OAuth 2.0的Passport策略验证 Fitbit 。
我的应用程序是React + Express 4 Web应用程序,并在react组件的构造函数中执行此授权。但得到以下错误。
connect.js:33 Uncaught TypeError: Cannot read property 'prototype' of undefined
at Function.exports.__monkeypatchNode (webpack:///./~/passport/lib/framework/connect.js?:33:23)
at module.exports (webpack:///./~/passport/lib/framework/connect.js?:21:11)
at Authenticator.init (webpack:///./~/passport/lib/authenticator.js?:30:43)
at new Authenticator (webpack:///./~/passport/lib/authenticator.js?:21:8)
at eval (webpack:///./~/passport/lib/index.js?:13:28)
at Object.<anonymous> (http://localhost:9020/app.js:8337:2)
at __webpack_require__ (http://localhost:9020/vendor.js:586:30)
at fn (http://localhost:9020/vendor.js:110:20)
at Object.eval (webpack:///./src/components/Asset/FitbitSensorInfo/FitbitSensorInfo.container.js?:31:17)
at eval (webpack:///./src/components/Asset/FitbitSensorInfo/FitbitSensorInfo.container.js?:290:30)
at Object.<anonymous> (http://localhost:9020/app.js:8331:2)
at __webpack_require__ (http://localhost:9020/vendor.js:586:30)
at fn (http://localhost:9020/vendor.js:110:20)
at Object.eval (webpack:///./src/components/Asset/FitbitSensorInfo/FitbitSensorInfo.widget.js?:41:25)
at eval (webpack:///./src/components/Asset/FitbitSensorInfo/FitbitSensorInfo.widget.js?:118:30)
at Object.<anonymous> (http://localhost:9020/app.js:8325:2)
at __webpack_require__ (http://localhost:9020/vendor.js:586:30)
at fn (http://localhost:9020/vendor.js:110:20)
at eval (webpack:///./src/components/Asset/FitbitSensorInfo/index.js?:11:26)
at Object.<anonymous> (http://localhost:9020/app.js:8307:2)
at __webpack_require__ (http://localhost:9020/vendor.js:586:30)
at fn (http://localhost:9020/vendor.js:110:20)
at Object.eval (webpack:///./src/pages/Assets/Single/Overview/OverviewPage.js?:69:25)
at eval (webpack:///./src/pages/Assets/Single/Overview/OverviewPage.js?:313:30)
at Object.<anonymous> (http://localhost:9020/app.js:6363:2)
at __webpack_require__ (http://localhost:9020/vendor.js:586:30)
at fn (http://localhost:9020/vendor.js:110:20)
at eval (webpack:///./src/pages/Assets/Single/Overview/AssetOverviewPage.js?:11:21)
at Object.<anonymous> (http://localhost:9020/app.js:6357:2)
at __webpack_require__ (http://localhost:9020/vendor.js:586:30)
at fn (http://localhost:9020/vendor.js:110:20)
at eval (webpack:///./src/pages/Assets/Single/Overview/index.js?:7:26)
at Object.<anonymous> (http://localhost:9020/app.js:6351:2)
at __webpack_require__ (http://localhost:9020/vendor.js:586:30)
at fn (http://localhost:9020/vendor.js:110:20)
at Object.getComponent (webpack:///./src/routes/index.js?:73:18)
at getComponentsForRoute (webpack:///./~/react-router/lib/getComponents.js?:17:40)
at eval (webpack:///./~/react-router/lib/getComponents.js?:35:5)
at eval (webpack:///./~/react-router/lib/AsyncUtils.js?:84:5)
at Array.forEach (native)
at mapAsync (webpack:///./~/react-router/lib/AsyncUtils.js?:83:9)
at getComponents (webpack:///./~/react-router/lib/getComponents.js?:34:28)
at finishEnterHooks (webpack:///./~/react-router/lib/createTransitionManager.js?:93:35)
at runTransitionHooks (webpack:///./~/react-router/lib/TransitionUtils.js?:80:5)
at runEnterHooks (webpack:///./~/react-router/lib/TransitionUtils.js?:113:10)
at eval (webpack:///./~/react-router/lib/createTransitionManager.js?:86:42)
at runTransitionHooks (webpack:///./~/react-router/lib/TransitionUtils.js?:80:5)
at runChangeHooks (webpack:///./~/react-router/lib/TransitionUtils.js?:137:10)
at finishMatch (webpack:///./~/react-router/lib/createTransitionManager.js?:83:41)
at eval (webpack:///./~/react-router/lib/createTransitionManager.js?:61:11)
exports.__monkeypatchNode @ connect.js:33
module.exports @ connect.js:21
Authenticator.init @ authenticator.js:30
Authenticator @ authenticator.js:21
(anonymous) @ index.js:13
(anonymous) @ app.js:8337
__webpack_require__ @ vendor.js:586
fn @ vendor.js:110
(anonymous) @ FitbitSensorInfo.container.js:31
(anonymous) @ FitbitSensorInfo.container.js:290
(anonymous) @ app.js:8331
__webpack_require__ @ vendor.js:586
fn @ vendor.js:110
(anonymous) @ FitbitSensorInfo.widget.js:41
(anonymous) @ FitbitSensorInfo.widget.js:118
(anonymous) @ app.js:8325
__webpack_require__ @ vendor.js:586
fn @ vendor.js:110
(anonymous) @ index.js:11
(anonymous) @ app.js:8307
__webpack_require__ @ vendor.js:586
fn @ vendor.js:110
(anonymous) @ OverviewPage.js:69
(anonymous) @ OverviewPage.js:313
(anonymous) @ app.js:6363
__webpack_require__ @ vendor.js:586
fn @ vendor.js:110
(anonymous) @ AssetOverviewPage.js:11
(anonymous) @ app.js:6357
__webpack_require__ @ vendor.js:586
fn @ vendor.js:110
(anonymous) @ index.js:7
(anonymous) @ app.js:6351
__webpack_require__ @ vendor.js:586
fn @ vendor.js:110
getComponent @ index.js:73
getComponentsForRoute @ getComponents.js:17
(anonymous) @ getComponents.js:35
(anonymous) @ AsyncUtils.js:84
mapAsync @ AsyncUtils.js:83
getComponents @ getComponents.js:34
finishEnterHooks @ createTransitionManager.js:93
runTransitionHooks @ TransitionUtils.js:80
runEnterHooks @ TransitionUtils.js:113
(anonymous) @ createTransitionManager.js:86
runTransitionHooks @ TransitionUtils.js:80
runChangeHooks @ TransitionUtils.js:137
finishMatch @ createTransitionManager.js:83
(anonymous) @ createTransitionManager.js:61
next @ AsyncUtils.js:46
loopAsync @ AsyncUtils.js:56
matchRoutes @ matchRoutes.js:243
match @ createTransitionManager.js:57
historyListener @ createTransitionManager.js:238
listen @ createTransitionManager.js:262
Router_componentWillMount @ Router.js:121
(anonymous) @ ReactCompositeComponent.js:348
measureLifeCyclePerf @ ReactCompositeComponent.js:75
performInitialMount @ ReactCompositeComponent.js:347
mountComponent @ ReactCompositeComponent.js:258
mountComponent @ ReactReconciler.js:46
performInitialMount @ ReactCompositeComponent.js:371
mountComponent @ ReactCompositeComponent.js:258
mountComponent @ ReactReconciler.js:46
performInitialMount @ ReactCompositeComponent.js:371
mountComponent @ ReactCompositeComponent.js:258
mountComponent @ ReactReconciler.js:46
mountComponentIntoNode @ ReactMount.js:104
perform @ Transaction.js:140
batchedMountComponentIntoNode @ ReactMount.js:126
perform @ Transaction.js:140
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
batchedUpdates @ ReactUpdates.js:97
_renderNewRootComponent @ ReactMount.js:320
_renderSubtreeIntoContainer @ ReactMount.js:401
render @ ReactMount.js:422
(anonymous) @ index.js:79
(anonymous) @ app.js:11
__webpack_require__ @ vendor.js:586
fn @ vendor.js:110
(anonymous) @ multi_app:1
(anonymous) @ app.js:5
__webpack_require__ @ vendor.js:586
webpackJsonpCallback @ vendor.js:22
(anonymous) @ app.js:1