useAsyncStoryblok not fetching content in storyblok visual editor #841
Labels
pending-author
[Issue] Awaiting further information or action from the issue author
pending-triage
[Issue] Ticket is pending to be prioritised
Describe the issue you're facing
It would appear that there is a race condition in
src/runtime/composables/useAsyncStoryblok.ts
when using the visual editor in storyblok that leads to no data being received in time and throwing an error:Cannot read properties of undefined (reading 'id')
sincestory
is returning null in the following snippet:Reverting the above snippet to the one below resolves this
Not sure if there are other changes regarding this that is needed to make it work.
Reproduction
https://storyblok.com
Steps to reproduce
Using the visual editor in storyblok will result in the error being thrown. Please note that it has to be used with the serving of the build files and not using
npm run dev
oryarn dev
.Unfortunately I am not able to share the repository
System Info
Used Package Manager
yarn
Error logs (Optional)
No response
Validations
The text was updated successfully, but these errors were encountered: