Closed rendomnet closed 9 months ago
Usually situations like this are caused by accidentally having 2 different copies of moment
somewhere in the dependency tree. See the "npm" and/or "yarn" sections at https://github.com/moment/moment-timezone/issues/982#issuecomment-1119540905 for tips to verify if that's the problem (and how to fix it).
@gilmoreorless I have only this
"moment": "^2.29.4",
"moment-timezone": "^0.5.43",
What's specified in package.json
is only part of the story. As https://github.com/moment/moment-timezone/issues/982#issuecomment-1119540905 explains, what matters is how the dependencies are actually installed in node_modules
. moment-timezone
could be depending on a version of moment
that's different from the one you've specified.
This is something I'm hoping to solve by moving moment
to be a peer dependency of moment-timezone
(https://github.com/moment/moment-timezone/issues/1039#issuecomment-1445251204).
I've completely removed the 'node_modules' directory and reinstalled it, but the issue still persists. Do I need to have "moment" for 'moment-timezone' to have the necessary locale files? Are they compatible?
If there's a lockfile like package-lock.json
or yarn.lock
that's storing the duplicate versions, removing node_modules
won't fix the problem. I've already linked to better explanations of how to diagnose and fix this.
Environment
{ "moment": "2.29.4", "momentTz": "0.5.43", "date": "Sat Oct 28 2023 16:45:48 GMT+0600 (East Kazakhstan Time)", "intlZone": "Asia/Almaty" }
Issue description
the locales do not load. But if I use
then it works