erikras/redux-promise-listener

Error: "Actions may not have an undefined "type" property.

stefanfrede opened this issue · 1 comments

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

I use the provided code of step 1 and step 2 and get the following error:
Error: "Actions may not have an undefined "type" property. Have you misspelled a constant?".

          const generatedAsyncFunction = promiseListener.createAsyncFunction(
            'START_ACTION_TYPE',
            'RESOLVE_ACTION_TYPE',
            'REJECT_ACTION_TYPE',
          );

          const values = {
            type: REQUEST_ITEMS,
            payload: { eventName, request },
          };

          generatedAsyncFunction.asyncFunction(values).then(
            resolvePayload => {
              console.log('foo: ', resolvePayload);
            },

            rejectPayload => {
              console.log('bar: ', rejectPayload);
            },
          );

          generatedAsyncFunction.unsubscribe();

What is the expected behavior?

To not get an error.

What's your environment?

node: 8.12.0
redux-promise-listener: 1.1.0
macOS: 10.13.6

Other information

Error: "Actions may not have an undefined "type" property. Have you misspelled a constant?"
performAction http://localhost:8080/:1:40951
liftAction http://localhost:8080/:1:34375
dispatch http://localhost:8080/:1:38408
middleware webpack:///./node_modules/redux-promise-listener/dist/redux-promise-listener.es.js?:46:16
sagaMiddleware webpack:///./node_modules/redux-saga/dist/redux-saga-core.esm.js?:1414:22
dispatch webpack:///./node_modules/redux/es/redux.js?:571:18
asyncFunction webpack:///./node_modules/redux-promise-listener/dist/redux-promise-listener.es.js?:61:9
asyncFunction webpack:///./node_modules/redux-promise-listener/dist/redux-promise-listener.es.js?:60:14
t0 webpack:///./src/rumo-socket.js?./node_modules/babel-loader/lib:608:19
Promise webpack:///./node_modules/core-js/library/modules/es6.promise.js?:177:7
_callee11$ webpack:///./src/rumo-socket.js?./node_modules/babel-loader/lib:594:33
tryCatch webpack:///./node_modules/regenerator-runtime/runtime.js?:62:37
invoke webpack:///./node_modules/regenerator-runtime/runtime.js?:288:22
method webpack:///./node_modules/regenerator-runtime/runtime.js?:114:16
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:5:24
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:27:9
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:34:7
Promise webpack:///./node_modules/core-js/library/modules/es6.promise.js?:177:7
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:23:12
_emit webpack:///./src/rumo-socket.js?./node_modules/babel-loader/lib:665:16
_callee$ webpack:///./src/rumo-socket.js?./node_modules/babel-loader/lib:86:24
tryCatch webpack:///./node_modules/regenerator-runtime/runtime.js?:62:37
invoke webpack:///./node_modules/regenerator-runtime/runtime.js?:288:22
method webpack:///./node_modules/regenerator-runtime/runtime.js?:114:16
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:5:24
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:27:9
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:34:7
Promise webpack:///./node_modules/core-js/library/modules/es6.promise.js?:177:7
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:23:12
request webpack:///./src/rumo-socket.js?./node_modules/babel-loader/lib:102:16
_callee4$ webpack:///./src/rumo-socket.js?./node_modules/babel-loader/lib:187:24
tryCatch webpack:///./node_modules/regenerator-runtime/runtime.js?:62:37
invoke webpack:///./node_modules/regenerator-runtime/runtime.js?:288:22
method webpack:///./node_modules/regenerator-runtime/runtime.js?:114:16
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:5:24
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:27:9
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:34:7
Promise webpack:///./node_modules/core-js/library/modules/es6.promise.js?:177:7
node_modules babel/runtime-corejs2/helpers/asyncToGenerator.js?:23:12
PUT webpack:///./src/rumo-socket.js?./node_modules/babel-loader/lib:206:16
Scratchpad/1:55:9

I found my answers in the code and updated the README accordingly (#12).