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

Does not work with vite #319

Closed
icodeforlove opened this issue Nov 29, 2024 · 5 comments
Closed

Does not work with vite #319

icodeforlove opened this issue Nov 29, 2024 · 5 comments

Comments

@icodeforlove
Copy link

I am unable to use this in vite.

When i do the following on a fresh vite project it fails:

import { createReactQueryHooks } from "@rspc/react"; const rspc = createReactQueryHooks();

[vite] Internal server error: Failed to resolve entry for package "@rspc/react". The package may have incorrect main/module/exports specified in its package.json.

@espeon
Copy link
Contributor

espeon commented Nov 29, 2024

apparently you're supposed to use @rspc/react-query, seems like the docs aren't up to date. i switched and it fixed that issue.

@icodeforlove
Copy link
Author

@espeon When I switched over to @rspc/react-query it initially failed because it could not find the types.

I was able to manually go into the modules files, and move the type files next to the build files to get that working.

Did this work for you out of the box?

@espeon
Copy link
Contributor

espeon commented Dec 1, 2024

No, had to add types as well. Seems to me the dev only somehow exported the built objects and not included the source files/types

@marcocondrache
Copy link
Contributor

I've made PR #322 to fix types generation for those packages. @espeon

@oscartbeaumont
Copy link
Member

Changes have been release. Feel free to reopen the issue if you still have problems!

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

No branches or pull requests

4 participants