You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found the code that prevents this from working & when I make a couple of small adjustments locally, it all seems to work fine. So far, I'm not seeing any issues or side effects with the edits I've made. For now I've applied them locally via a patch.
The set method and runtime check are combined into a single if statement e.g. if (globalThis.storyCache.set(e.uuid, e), process.env.NEXT_RUNTIME)
The set method then does not fire, however if I manually move it outside the if statement it's all working correctly.
I can look to put together a reproduction, however, this issue is only occurring within Storyblok when using the bridge.
Both fixes here feel a little strange. I can't quite figure out yet why my changes fix live editing - but they do.
Thanks for reporting @brightonmike. ATM the SDK and JS Client are only officially supporting using the Client's exposed APIs (get, getStory, ...) and not custom fetch or GraphQL.
However, I would like to be able to fully and officially support them, like within the scenario you described here.
I cannot guarantee I will be able to prioritize this, but if you could submit a PR this may be a good start.
Describe the issue you're facing
I couldn't get live editing to work. Content edits are only showing up when you save a page.
I followed this page: https://github.com/storyblok/storyblok-react?tab=readme-ov-file#nextjs-using-app-router
The only difference is I am using custom GraphQL data fetching.
I've found the code that prevents this from working & when I make a couple of small adjustments locally, it all seems to work fine. So far, I'm not seeing any issues or side effects with the edits I've made. For now I've applied them locally via a patch.
Here I remove this check for the window object: https://github.com/storyblok/storyblok-react/blob/main/src/rsc/live-editing.tsx#L8
When bundled, this code stops working: https://github.com/storyblok/storyblok-react/blob/main/src/rsc/live-edit-update-action.ts#L11
The set method and runtime check are combined into a single if statement e.g.
if (globalThis.storyCache.set(e.uuid, e), process.env.NEXT_RUNTIME)
The set method then does not fire, however if I manually move it outside the if statement it's all working correctly.
I can look to put together a reproduction, however, this issue is only occurring within Storyblok when using the bridge.
Both fixes here feel a little strange. I can't quite figure out yet why my changes fix live editing - but they do.
Reproduction
na
Steps to reproduce
No response
System Info
Used Package Manager
yarn
Error logs (Optional)
No response
Validations
The text was updated successfully, but these errors were encountered: