TypeError: (0 , _moment2.default) is not a function
See original GitHub issueI’m trying to use antd as a component library with my existing build system (webpack 2). Can I use components from this library without importing the entire build system? I did
npm install antd
and in my page, added
import { DatePicker } from 'antd'
export function Page(){
return <DatePicker/>
}
Error
Uncaught TypeError: (0 , _moment2.default) is not a function
at Function.getDefaultProps (?d41d*:78)
at Object.createClass (ReactClass.js:675)
at Object../node_modules/rc-time-picker/lib/Panel.js (?d41d*:45)
at __webpack_require__ (bootstrap d2f4533…:689)
at fn (bootstrap d2f4533…:110)
at Object../node_modules/antd/lib/date-picker/wrapPicker.js (wrapPicker.js:21)
at __webpack_require__ (bootstrap d2f4533…:689)
at fn (bootstrap d2f4533…:110)
at Object../node_modules/antd/lib/date-picker/index.js (index.js:23)
at __webpack_require__ (bootstrap d2f4533…:689)
Environment
webpack 2 Antd 2.4.3 Node 7 OSX 10.10
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:25 (9 by maintainers)
Top Results From Across the Web
Uncaught TypeError: _moment2.default.date is not a function ...
When I call Moment just in the render() function, I don't get this error. But, I need the date information in the state...
Read more >(0 , import_defineToJSON.default) is not a function - Bugs
When trying to import '@8base/auth' to a Vite+Vue 3 project, the following error is trigger by the import statement. Uncaught TypeError: (0 ......
Read more >Uncaught TypeError: _moment2.default.date is not a function ...
Coding example for the question Uncaught TypeError: _moment2.default.date is not a function in React app-Reactjs.
Read more >typeerror: (0 , express_1.default) is not a function - You.com
I'm getting [TypeError: (0 , express_1.default) is not a function for my code. import express from "express"; const app = express (); //...
Read more >TypeError - (0 , _requireHook).default is not a function
I'm getting TypeError: (0 , _requireHook).default is not a function at Object.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try this: https://github.com/webpack/webpack/issues/1694#issuecomment-164481066
@KhushbooTaneja This alias has to be added in the
webpack
configuration. details.