Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug]: Can't stash files in a Trigger hook's perform. #828

Open
mateop42dev opened this issue Jul 25, 2024 · 0 comments
Open

[Bug]: Can't stash files in a Trigger hook's perform. #828

mateop42dev opened this issue Jul 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mateop42dev
Copy link

mateop42dev commented Jul 25, 2024

Bug Description

You can't stash files in a Trigger hook's perform.

Reproduction Steps

  1. Use an Typescript app
  2. Create a trigger file with a perform method, etc... and declare it as a triggers in your index
  3. Create hydrator.js with a downloadFile() method which use z.stashfiles with binary data, and declare it as an hydrators in your index
  4. Import hydrators and call hydrators.downloadFile() in your perform methods from your trigger.
    If you're looking at the logs, it's going into the downloadFile method, but you're getting a "Files can only be stashed within a create or hydracation function/method" error.

Zapier Platform version

15.10.0

Node.js version

20.11.0

Your Operating System

Windows 10

npm/yarn version

10.2.4

App ID

No response

More Details

The problem is that only Hydrators and Creates can stash files, but even if you use an hydrator methods IN a hook's perform, the zapier.event will start by triggers.(...).perform, and not by hydrations. So an error will be throwed.
(altought documentation is saying that you can stash files in an hydration method or an hook's perform...)
This is at least the case in a typescript project.

@mateop42dev mateop42dev added the bug Something isn't working label Jul 25, 2024
@mateop42dev mateop42dev changed the title [Bug]: [Bug]: Can't stash files in a Trigger hook's perform. Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant