Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fetchData call fails if no object returned at end #918

Closed
rguldener opened this issue Aug 14, 2023 · 1 comment · Fixed by #956
Closed

fetchData call fails if no object returned at end #918

rguldener opened this issue Aug 14, 2023 · 1 comment · Fixed by #956
Assignees
Labels
bug Something isn't working

Comments

@rguldener
Copy link
Member

rguldener commented Aug 14, 2023

As reported on the community: nango dryrun throws an error if one tries to dryrun a script which doesn't return anything at the end.
The syncs also fail on Nango cloud for the same reason.

export default async function fetchData(
  nango: NangoSync
): Promise<void> {

// Function

}

Workaround for now:
Use the old format with the return { 'Model': [] }

Since we want to move to this format this should be fixed :)

@rguldener rguldener added the bug Something isn't working label Aug 14, 2023
@rguldener rguldener changed the title nango dryrun fails with new sync scripts signature fetchData call fails if no object returned at end Aug 14, 2023
@khaliqgant
Copy link
Member

khaliqgant commented Aug 16, 2023

Requires an undefined check here: https://github.com/NangoHQ/nango/blob/master/packages/shared/lib/services/sync/run.service.ts#L230

if (userDefinedResults &&

Also need to signal that the script is finished ending so the log can be terminated and the webhook can be sent

Related to #912

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants