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') since story is returning null in the following snippet:
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 or yarn dev.
Unfortunately I am not able to share the repository
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 repositorySystem Info
Used Package Manager
yarn
Error logs (Optional)
No response
Validations