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

Doesnt properly work with ssr: false; nuxt3 #6

Open
steinathan opened this issue Jul 20, 2022 · 2 comments
Open

Doesnt properly work with ssr: false; nuxt3 #6

steinathan opened this issue Jul 20, 2022 · 2 comments

Comments

@steinathan
Copy link

Disabling ssr ( ssr: false) produces this error

Unexpected token u in JSON at position 0

commenting out this line works

 cache.restore(JSON.parse(JSON.stringify(nuxt.payload.data["apollo-" + clientId])));

Screenshot from 2022-07-20 14-02-20

Not sure why this happened

@steinathan
Copy link
Author

Forking and adding replacing this line temporarily fixed my problem

      const cacheData = JSON.stringify(nuxt.payload.data["apollo-" + clientId] ?? {})
      cache.restore(JSON.parse(cacheData));

@Luferov
Copy link

Luferov commented Aug 30, 2022

Forking and adding replacing this line temporarily fixed my problem

      const cacheData = JSON.stringify(nuxt.payload.data["apollo-" + clientId] ?? {})
      cache.restore(JSON.parse(cacheData));

Could you send PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants