Moment-timezone: moment(...).tz is not a function

Created on 3 Apr 2017  路  10Comments  路  Source: moment/moment-timezone

I've updated my bower components to the latest version of moment-timezone(0.5.12). After which I'm getting below error.

TypeError: moment(...).tz is not a function

Most helpful comment

@KusumaShree @Multiply
I think the problem is in file bower.json : the indicated parameter
"main": "builds/moment-timezone-with-data-2010-2020.js"
is a file that no longer exists.

@mj1856 can you fix your update pease?

All 10 comments

Same issue for us.

@KusumaShree @Multiply
I think the problem is in file bower.json : the indicated parameter
"main": "builds/moment-timezone-with-data-2010-2020.js"
is a file that no longer exists.

@mj1856 can you fix your update pease?

@foucdeg See our temp fixes in #466

Thanks!

Same issue here. I think this issue is pretty critical.

Build broken here too, I would also say that this is a critical issue.

Should work now. Please try again. Thanks.

Dup #466

If you're using Node.js, you may accidentally be using

const moment = require('moment'); //moment

instead of

const moment = require('moment-timezone'); //moment-timezone

Also, make sure you have installed moment-timezone with

npm install moment-timezone --save

If you are using yarn, removing yarn.lock, node_modules dir and running yarn install has solved this for me.

Shown same error in browser

Was this page helpful?
0 / 5 - 0 ratings