🙋 moment.js zh-cn fail
See original GitHub issueUsing the following code to do the Sinization of the time, it is failed by parcel. But by webpack,it is ok. Can you help me?
import moment from 'moment';
import 'moment/locale/zh-cn'
moment.locale('zh-cn');

Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Guides - Moment.js
The guides area is designed to help developers learn to better interact with the date and time problem domain, and the Moment.js library....
Read more >How to set language globally for moment.js - Stack Overflow
You can change moment locale globally like that: import moment from 'moment'; import localization from 'moment/locale/fr'; moment.locale('fr', localization);.
Read more >⚓ T123080 Moment.js does not support all Chinese ...
This will cause modules depending on momentjs to display English fallback if the interface language for the user is zh-Hans, for example. Details....
Read more >MomentJS - Quick Guide - Tutorialspoint
Moment JS allows displaying of date as per localization and in human readable format. You can use MomentJS inside a browser using the...
Read more >Javacript 3.23 bug with momentjs package? - Esri Community
It seems that the extra .js on moment in init.js is crapping things out and I notice that this has changed in JS...
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 Free
Top 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

@PlayMa256 it shouldn’t work on this case.
The problem :
import moment from 'moment'is resolved to an ES6 module, according to themodulepackage.jsonfieldimport 'moment/locale/zh-cn'is resolved to an UMD module, which uses the moment commonjs moduleWhat it means : you are using ES6 moment, the locale uses CommonJS moment, it’s two different instances, so the locale will not apply.
Workaround (pick one) :
Caused by #299 (follow up #359), related to #418
What is the error that parcel throws? Or none?