-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
Asynchronous filter returns a Promise object #3133
Comments
Hey @patrulea, As far as I can tell async filters should work correctly. In my test I just switched the sanity endpoint to swapi.dev. Maybe you could create a reproducable git repo or something, so I can test it with your code. |
https://github.com/patrulea/issue-3133 There it is. Logging the data from the filter does result in what I’m expecting. Though, logging it from the template (through the Eleventy |
Ahh, that's the issue.
In my opinion it would be nice to change the log filter to await the value by default. That way you could use the filter like you expected to above. |
oooh right. I successfully rendered the fetched data with |
|
Operating system
macOS Sonoma 14.2.1
Eleventy
2.0.1
Describe the bug
I’m writing an async filter to fetch the data of a Sanity document based on its ID.
Logging the data in the console works as expected, but trying to render the result within a template doesn’t, as it returns an empty object (
Promise { <pending> }
).This is a WebC template but I don’t think it’s related to that.
The text was updated successfully, but these errors were encountered: