Closed felipeloha closed 4 years ago
I got the same problem but then with plugin https://github.com/Eonasdan/bootstrap-datetimepicker i'm running momentjs version 2.25.2
The error:
bootstrap-datetimepicker.js:2458 Uncaught TypeError: moment.locale is not a function
at Object.<anonymous> (bootstrap-datetimepicker.js:2458)
at bootstrap-datetimepicker.js:40
at Object../node_modules/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js (bootstrap-datetimepicker.js:53)
at __webpack_require__ (bootstrap:19)
at Object.<anonymous> (page-account-edit.js:3)
at Object../assets/js/page-account-edit.js (page-account-edit.1f12d24e.js:456)
at __webpack_require__ (bootstrap:19)
at Object.39 (module.js:22)
at __webpack_require__ (bootstrap:19)
at bootstrap:83
i solved by downgrading the fix version to 2.24.0
"moment": "2.24.0",
Does it still work with 2.25.3 ?
@felipeloha ?
I will close for now. Please re-open in https://github.com/moment/moment if you are still experiencing issues. It is similar to some issues like https://github.com/moment/moment/issues/5507 .
Best of luck!
Just in case someone comes here with Vite: an older version of PHPStorm imported moment
like
import * as moment from 'moment';
this works for webpack and the development process but Vite will the error above in bundled JS builds because "moment()
" returns undefined
in that case
So in case you are using Vite, always import moment
with
import moment from 'moment';
Hello,
I have a react application served by nginx and im getting following error:
the application runs locally without problems but when I deploy it to the server on nginx it doesnt work. any idea what it could be?
thanks in advance
dependencies: