Taken me quite some time to replicate this in a large project, because it works without a problem in a new qwik project on it's own. After deleting 99% of my project and seeing it still happened, I realised that it only happens in a qwik-nx project.
I'm not sure what's different from a regular qwik project but if you copy components/routes then you'll see it works in one.
This workaround doesn't work because I guess it gets collapsed down?
export function useToasterApi() {
return useContext(ToasterApiContextId);
}
But it works if you make the function more complex so it doesn't get collapsed
Current Behavior
When you destructure 2x useContext in a single component like so:
Then you get an error like so:
Expected Behavior
It should compile/serve/build without a problem (like in a standard qwik project)
GitHub Repo
https://github.com/intellix/qwik-nx-context-2-bug
Steps to Reproduce
Nx Report
Failure Logs
No response
Additional Information
Taken me quite some time to replicate this in a large project, because it works without a problem in a new qwik project on it's own. After deleting 99% of my project and seeing it still happened, I realised that it only happens in a qwik-nx project.
I'm not sure what's different from a regular qwik project but if you copy components/routes then you'll see it works in one.
This workaround doesn't work because I guess it gets collapsed down?
But it works if you make the function more complex so it doesn't get collapsed