JSQuery Error "Cannot read properties of undefined (reading 'type')"

Trying to run a really simple test but I am getting the following error.
What am I doing wrong here? If you could please help, I would appreciate it!

Eventually this is what i would like to do. Note: getStuff() is a fake function name

  if (retoolContext.environment == "production") {
  } else {


Hi @grywrnglr

Thanks for reaching out! :thinking: I'm not able to reproduce this issue. The exact same query is working for me in my tests. Are you still seeing this error? Any chance you'd be ok with me logging in to your account to take a look?

I'm getting the same "datasource run failed" error. This is happening even when the function code is completely empty!

I'm guessing it must be something completely unrelated. The document I'm using has a lot of code and components. In a different, mostly empty document, JS Code snippets work fine.

1 Like

Hi @kiano I'm also happy to step in to your account and take a look to see if anything jumps out - let me know!

Hello @Tess - yes, please log in to my account and take a look.
This was happening with retool page with ID 3b3dd9ec-0157-11ee-aa68-a399c1614e09.

This seems to be a strange transient issue. It went like this:

  • A bit ago (about 3:50pm pacific time today), I started having a problem with my get_certificate_presigned_url resource query. Normally this runs some JS to put an API response into a text field, but it wasn't working. In the console I saw "Cannot read properties of undefined (reading 'type')".
  • I then created a new Javascript query, put console.log('hello') into it, ran it, and got the same 'undefined' error.

Then I refreshed the page and I couldn't recreate it again. It seemed to just start working somehow.