Skip to content

createAction not accepting null as second argument #169

Closed
@Bouncey

Description

@Bouncey

I have just tried to v1.0.1 and I am getting this error stack.

Throws this error stack

Failed loading boot script: /home/stuart/freecodecamp/server/boot/react.js
Invariant Violation: Expected payloadCreator to be a function or undefined
    at invariant (/home/stuart/freecodecamp/node_modules/invariant/invariant.js:42:15)
    at createAction (/home/stuart/freecodecamp/node_modules/redux-actions/lib/createAction.js:30:27)
    at Object.<anonymous> (/home/stuart/freecodecamp/common/app/redux/actions.js:24:27)
    at Module._compile (module.js:570:32)
    at loader (/home/stuart/freecodecamp/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/stuart/freecodecamp/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Function._load (/home/stuart/freecodecamp/node_modules/pmx/lib/transaction.js:62:21)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/stuart/freecodecamp/common/app/routes/challenges/components/map/Challenge.jsx:12:1)
    at Module._compile (module.js:570:32)
    at loader (/home/stuart/freecodecamp/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .jsx] (/home/stuart/freecodecamp/node_modules/babel-register/lib/node.js:154:7)
Invariant Violation: Expected payloadCreator to be a function or undefined
    at invariant (/home/stuart/freecodecamp/node_modules/invariant/invariant.js:42:15)
    at createAction (/home/stuart/freecodecamp/node_modules/redux-actions/lib/createAction.js:30:27)
    at Object.<anonymous> (/home/stuart/freecodecamp/common/app/redux/actions.js:24:27)
    at Module._compile (module.js:570:32)
    at loader (/home/stuart/freecodecamp/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/stuart/freecodecamp/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Function._load (/home/stuart/freecodecamp/node_modules/pmx/lib/transaction.js:62:21)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/stuart/freecodecamp/common/app/routes/challenges/components/map/Challenge.jsx:12:1)
    at Module._compile (module.js:570:32)
    at loader (/home/stuart/freecodecamp/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .jsx] (/home/stuart/freecodecamp/node_modules/babel-register/lib/node.js:154:7)

The actions causing the error are in this format

export const toggleMapDrawer = createAction(
  types.toggleMapDrawer,
  null,
  () => createEventMeta({
    category: 'Nav',
    action: 'toggled',
    label: 'Map drawer toggled'
  })
);

Any advice would be greatly appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions