I can't get the custom JS results out, always get error!

Hello,

I’m trying to get Sun calculations, I use custom JS for that, I think I put inputs and outputs, etc. correctly but I can’t get it done, I tried many variations of the code and always get the catch error message.

my app url: https://platform.appgyver.com/builder/applications/190371/pages/1

I use the calculations from: GitHub - mourner/suncalc: A tiny JavaScript library for calculating sun/moon positions and phases.

the screenshot I took the part of calling the function:

Could you please check what I am doing wrong, I try many other ways so the app page seems a mess, sorry about that, the particular calculation I am talking about is bound to the Card1 tap,

thank you.

One thing to note is that the GPS started not to work, even the phone location is on, the app doesn’t get the location.

Hi, sorry for the delayed response. Did you manage to get the custom JS to work?

Thank you @Mari for the reply, I simplified the app-in elements to clear and see better, I want the JS code to work, it is the main idea, it is ready, I think I’m doing wrong in how to call the functions, could you help me run successfully, I tried to do it in many ways, just couldn’t get it,

the app number is up in the previous message, the app URL,

Thank you very much.

I’m also interested in your solution, since I receive the same error when attempting to use custom JS.

Hey @yasin_sahin, I’m curious as to how are you loading the library code into the JS custom function?

Hey @Juan_Giraldo, I use the plain JS code from the suncalc codes (I gave the GitHub link above), supposedly the functions are there and ready to be called, I try to call with different combinations, but can’t get it right, I tried with different data types, variable varieties, etc. as well, no luck so far,

I’m still not sure what you mean. Looking at the library in GitHub, did you just paste the contents of the suncalc.js file into your custom JS flow function?

yes, of course, no change, just the code itself, trying to call, well maybe I’ll do some changes, but I want to run it successfully first,

Hi @yasin_sahin, sorry I overlooked what you were actually trying to do here – unfortunately it’s not yet possible to use custom libraries in the JS node, but custom plugins are on the development roadmap. :slight_smile:

Hey @Mari, any latest update on custom plugins? Will it be released this year?

Hi @Mari, the JS code has a bunch of calculations, is there any custom library in the code, I didn’t get fully what you said, you mean “Custom JS” doesn’t run with the code, did you check my app, the code is in the upper button, could you please specify because of what code it wouldn’t run,

thank you.