Shruti Desai
Posts: 0
Joined: Wed Apr 15, 2015 2:57 pm

moment.js - 'Uncaught ReferenceError: moment is not defined"

I'm trying to use moment.js in my script but get a 'Uncaught ReferenceError: moment is not defined' error. I made sure that it was present in the libraries under Server Code. What am I doing wrong?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

moment.js - 'Uncaught ReferenceError: moment is not defined"

Hello Shruti,

How do you add this library?
Do you follow https://devcenter.appery.io/documenta...?

Giorgio Draghetti
Posts: 0
Joined: Mon Oct 27, 2014 12:13 pm

moment.js - 'Uncaught ReferenceError: moment is not defined"

I reopen this because i'm unable to include moment.js.
I followed the documentation (i created Javascript from URL) but i get a syntax error on the created Javascript (see images).
Image
Image

moment() is not defined for my code.
Can you help me about this? What can i do?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

moment.js - 'Uncaught ReferenceError: moment is not defined"

Hi Jiorgio,

Tried the same and it works correctly.

Please check whether you have:

1 any console errors.
2 edited page sources(in sources tab).

Regards.

Giorgio Draghetti
Posts: 0
Joined: Mon Oct 27, 2014 12:13 pm

moment.js - 'Uncaught ReferenceError: moment is not defined"

You mean that you downloaded moment.js without source code errors?
I really can't understand.
I pressed "Create JavaScript" button and the moment.js source code is appeared on the screen with the error reported in the above screen. No edit.
I tried using Appery.io in chrome, safari and firefox.
Always the same result: code error.
No errors in the console log.

Sto per piangere ...

Can you try to do import this inside my app?
Just to be sure ... i'm stupid.
This is what happens to me: https://youtu.be/LieziuGwLVw

The app is shared with the support.
The name is "CarAngel"
This is the editing link
http://appery.io/app/project/f3da3ecd...

Thanks in advance.

Giorgio Draghetti
Posts: 0
Joined: Mon Oct 27, 2014 12:13 pm

moment.js - 'Uncaught ReferenceError: moment is not defined"

Solved: adding
http://momentjs.com/downloads/moment.js
in Project -- App settings -- User-defined resources
seems to be working ...
Not so clear why but ... in Appery.io I trust
:-))

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

moment.js - 'Uncaught ReferenceError: moment is not defined"

Glad it works now. Thanks for update, Giorgio!

MobiPayKLtd
Posts: 0
Joined: Wed Aug 23, 2017 3:27 pm

moment.js - 'Uncaught ReferenceError: moment is not defined"

I was able to use moment by placing it at the top. I used npm install moment for my website https://madayerweb.co.ke.

Return to “Issues”