Page 1 of 1
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Wed Apr 15, 2015 2:57 pm
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?
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Thu Apr 16, 2015 6:12 am
by Alena Prykhodko
Hello Shruti,
How do you add this library?
Do you follow https://devcenter.appery.io/documenta...?
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Wed Apr 29, 2015 6:58 pm
by Shruti Desai
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Tue Jun 09, 2015 1:34 pm
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).
moment() is not defined for my code.
Can you help me about this? What can i do?
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Tue Jun 09, 2015 10:41 pm
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.
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Wed Jun 10, 2015 2:27 pm
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.
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Wed Jun 10, 2015 3:33 pm
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
)
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Wed Jun 10, 2015 3:50 pm
by Illya Stepanov
Glad it works now. Thanks for update, Giorgio!
moment.js - 'Uncaught ReferenceError: moment is not defined"
Posted: Wed Aug 23, 2017 3:27 pm
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.