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

This forum contains topics that were moved from Get Satisfaction
Shruti Desai
Posts: 0
Joined: Wed Apr 15, 2015 2:57 pm

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

Post by Shruti Desai »

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"

Post by Alena Prykhodko »

Hello Shruti,

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

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

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

Post by Shruti Desai »

it works now.

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

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

Post by Giorgio Draghetti »

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"

Post by Yurii Orishchuk »

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"

Post by Giorgio Draghetti »

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"

Post by Giorgio Draghetti »

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"

Post by Illya Stepanov »

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"

Post by MobiPayKLtd »

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

Post Reply