storyblok-nuxt icon indicating copy to clipboard operation
storyblok-nuxt copied to clipboard

useAsyncStoryblok returns undefined when story is not found

Open LukasHechenbergerID opened this issue 9 months ago • 2 comments

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 avatar Apr 26 '24 09:04 LukasHechenbergerID

Reproduction Sorry, none

Hi, @LukasHechenbergerID please provide a minimal reproduction link using https://stackblitz.com/fork/github/nuxt/starter/tree/v3-stackblitz. See Why Reproductions are required

alvarosabu avatar Apr 29 '24 07:04 alvarosabu

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

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

m0zz094 avatar Aug 05 '24 10:08 m0zz094