qwik: [🐞] Context does not exist after SSR and navigating to a new page using

Which component is affected?

Qwik City (routing)

Describe the bug

After providing a context from the root component, it no longer exists when navigating to a new page.

The following error is thrown:

Actual value for useContext() can not be found, make sure some ancestor component has set a value using useContextProvider() '...' Error: Code(13): Actual value for useContext() can not be found, make sure some ancestor component has set a value using useContextProvider()

Reproduction

https://stackblitz.com/edit/qwik-starter-8f1jai

Steps to reproduce

  • Provide a context on the root component (or from within a component that wraps around QwikCityProvider).
  • Navigate to a new page
  • Call useContext from the new page
  • Observe an error in the console

System Info

System:
    OS: macOS 12.0.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 109.90 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 7.13.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 107.0.5304.110
    Firefox: 107.0
    Safari: 15.1
  npmPackages:
    @builder.io/qwik: ^0.14.0 => 0.14.0 
    @builder.io/qwik-city: ^0.0.125 => 0.0.125 
    vite: 3.2.4 => 3.2.4

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

@DustinJSilk all good. don’t get me wrong. my comment was just to outline where the context issue occurs. it’s not within the MPA logic of qwik but during SPA navigations. just tried to limit the scope of the issue and not questioning if and with which prio it should get fixed πŸ˜ƒ

@atinylittleshell your comment might get missed here, I’d suggest creating a new issue with a way to reproduce the problem