Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generateConfig[fn] is not a function for antd package #1033

Closed
wasd0109 opened this issue Mar 4, 2024 · 4 comments · Fixed by #1034
Closed

generateConfig[fn] is not a function for antd package #1033

wasd0109 opened this issue Mar 4, 2024 · 4 comments · Fixed by #1034

Comments

@wasd0109
Copy link

wasd0109 commented Mar 4, 2024

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

@chrisl8
Copy link

chrisl8 commented Mar 8, 2024

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 npm/cli#4942

@wasd0109
Copy link
Author

wasd0109 commented Mar 11, 2024

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

@ukrbublik ukrbublik linked a pull request Mar 13, 2024 that will close this issue
@12sachin95
Copy link

please publish latest version if this issue is fixed

@ns-sjadeja
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants