react-awesome-query-builder icon indicating copy to clipboard operation
react-awesome-query-builder copied to clipboard

generateConfig[fn] is not a function for antd package

Open wasd0109 opened this issue 11 months ago • 4 comments

Describe the bug The 'Uncaught TypeError: generateConfig2[fn] is not a function' error occurs when using the datetime widget from the antd package

To Reproduce

  1. Install the latest antd packages
  2. setup a query builder, with a field config of 'datetime'
  3. open the query builder and select the datetime field

Expected behavior RangePicker widget to be shown

Screenshots Screenshot 2024-03-04 at 16 37 44

Additional context Likely to be caused by a mismatch of dependency 'rc-picker' and 'antd'. The 'antd' version specified in package.json uses the function getMillisecond and setMillisecond from 'rc-picker', which does not exist in the 'rc-picker' version specified in package.json. Overriding the 'rc-picker' version to latest solve the problem

wasd0109 avatar Mar 04 '24 07:03 wasd0109

I believe the fix that the OP refered to is adding this to the package.json file of your project:

  "overrides": {
    "@react-awesome-query-builder/antd": {
      "rc-picker": "^4.3.0"
    }
  },

Tested, and this fix the issue for me.

Note that when using an override one cannot use npm ci but must use npm i instead, which is annoying. See https://github.com/npm/cli/issues/4942

chrisl8 avatar Mar 08 '24 15:03 chrisl8

Thank you and yes, that's what I was referring to, should've included more details about the fix.

wasd0109 avatar Mar 11 '24 04:03 wasd0109

please publish latest version if this issue is fixed

12sachin95 avatar May 01 '24 07:05 12sachin95

Facing this same issue with datetime widget. "@react-awesome-query-builder/antd": "^6.4.2", "@react-awesome-query-builder/ui": "^6.4.2", "react": "^18.2.0",

Applied above mentioned fix to override rc-picker version but it's giving another error mentioned below

/test/node_modules/react-scripts/scripts/start.js:19 throw err; ^

TypeError: fsevents.watch is not a function at createFSEventsInstance (/test/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:94:25) at setFSEventsListener (/test/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:150:16) at FsEventsHandler._watchWithFsEvents (/test/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:353:18) at FsEventsHandler.initWatch (/test/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:429:23) at FsEventsHandler._addToFsEvents (/test/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:518:12) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.12.2

ns-sjadeja avatar May 02 '24 09:05 ns-sjadeja