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

solid-query 4.20.2 and 4.20.4 fail to set queryClient in dev mode with vite #4673

Closed
eyenalxai opened this issue Dec 23, 2022 · 7 comments
Closed
Assignees
Labels

Comments

@eyenalxai
Copy link

eyenalxai commented Dec 23, 2022

Describe the bug

On versions 4.20.2 and above I get Uncaught Error: No QueryClient set, use QueryClientProvider to set one, but only in dev mode.

After build works fine. Previous version, 4.19.1, also works well in dev mode, as expected.

Your minimal, reproducible example

4.20.2 (Not working): https://stackblitz.com/edit/solidjs-templates-bkmykc
4.19.1 (Same code, working): https://stackblitz.com/edit/solidjs-templates-qwuff7

Repo with code used: https://github.com/eyenalxai/solid-query-bug

Steps to reproduce

  1. Create a solid project
  2. Install solid-query 4.20.2 or 4.20.4
  3. Perform initial configuration, add some fetching code

Expected behavior

I expected Uncaught Error: No QueryClient set not to happen but it did.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: MacOS
  • Browser: Chrome, Safari

Tanstack Query version

4.20.2 and 4.20.4

TypeScript version

4.8.2 and 4.5.4

Additional context

No response

@TkDodo
Copy link
Collaborator

TkDodo commented Dec 23, 2022

@ardeora fyi

@ardeora
Copy link
Contributor

ardeora commented Dec 23, 2022

Thanks! I'm taking a look at this.

@ardeora ardeora added the bug Something isn't working label Dec 23, 2022
@ardeora ardeora self-assigned this Dec 23, 2022
@tsujp
Copy link

tsujp commented Dec 28, 2022

For the sake of reproducibility I get this also with both the latest Deno and Nodejs. On macOS and Firefox.

@ardeora
Copy link
Contributor

ardeora commented Dec 29, 2022

Thank you so much for the thorough reproduction. I am still working on this and just posting this as an update. Building the library locally and using the build from the local server, The library works as expected. I published @adeora/solid-query with the exact same code to npm and I am getting the exact issue again. On first look, I'm thinking this is an issue somewhere where vite cannot correctly resolve the package. I'll keep you posted on my findings.

@ardeora
Copy link
Contributor

ardeora commented Dec 29, 2022

Update: I was able to create a minimal reproduction of this issue without any Tanstack query code and issue still persists. It seems like something maybe vite-plugin-solid cannot resolve correctly. More detailed explanation in the issue here on how to recreate the issue solidjs/vite-plugin-solid#80. Hopefully we shall hear back soon! If not, I'll just revert the changes back to the older version for now. I apologize for all the inconvenience caused here 😭

@thetarnav
Copy link

this might be related thisbeyond/solid-dnd#78

@TkDodo
Copy link
Collaborator

TkDodo commented Aug 29, 2023

I'll close this issue because a) it's an upstream issue and b) I think @ardeora has reverted the change

@TkDodo TkDodo closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants