Created
January 18, 2019 21:31
-
-
Save nitely/697b70960db5cc5e5e3c56dd8bd5445c to your computer and use it in GitHub Desktop.
moment.js timezone SyntaxError
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ERROR in ./node_modules/moment-timezone/data/packed/latest.json | |
Module parse failed: Unexpected token e in JSON at position 0 while parsing near 'export default { | |
Module build failed (from ./node_modules/babel-loader/lib/index.js): | |
SyntaxError: /usr/src/app/ui/src/tz: Unexpected token, expected ";" (1:10) | |
Here is a solution: | |
*/ | |
import 'moment-timezone/moment-timezone' | |
moment.tz.load({ | |
"version": "2018g", | |
"zones": ["Etc/UTC|UTC|0|0|"], | |
"links": [ | |
"Etc/UCT|UCT", | |
"Etc/UTC|Etc/Universal", | |
"Etc/UTC|Etc/Zulu", | |
"Etc/UTC|UTC", | |
"Etc/UTC|Universal", | |
"Etc/UTC|Zulu" | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment