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

useAsyncStoryblok returns undefined when story is not found #828

Open
1 task done
LukasHechenbergerID opened this issue Apr 26, 2024 · 2 comments
Open
1 task done
Labels
needs-reproduction [Contribution] The issue requires minimal reproduction. pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised

Comments

@LukasHechenbergerID
Copy link

Describe the issue you're facing

When calling useAsyncStoryblok with a nonexistent url, I get undefined back.

In the documentation there is this bit:
image
Previously there would be a status returned, regardless if the site exists or not.
But now you get undefined back and it throws an error (instead of a 404 there is a 500 shown to the user in my case)

Has the api changed?? I couldn't find infos on this

Reproduction

Sorry, none

Steps to reproduce

No response

System Info

Nuxt 3.11.2
@storyblok/nuxt 6.0.9

Used Package Manager

pnpm

Error logs (Optional)

No response

Validations

@LukasHechenbergerID LukasHechenbergerID added pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Apr 26, 2024
@alvarosabu alvarosabu added the needs-reproduction [Contribution] The issue requires minimal reproduction. label Apr 29, 2024
@alvarosabu
Copy link
Contributor

@m0zz094
Copy link

m0zz094 commented Aug 5, 2024

Same, I temporarely added this snippet instead to get a 404

if (!story?.value?.content) { throw createError({ statusCode: 404, statusMessage: 'Page Not Found' }) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-reproduction [Contribution] The issue requires minimal reproduction. pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised
Projects
None yet
Development

No branches or pull requests

3 participants