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

Package issue with vite/react causes build error #67

Open
whithr opened this issue Feb 21, 2024 · 1 comment
Open

Package issue with vite/react causes build error #67

whithr opened this issue Feb 21, 2024 · 1 comment

Comments

@whithr
Copy link

whithr commented Feb 21, 2024

Hi all, when installing @usebasejump/react in a project with vite, it looks like there's some issues with the npm package that causes the import to fail.

Error: (when importing anything with the package)

[ERROR] Failed to resolve entry for package "@usebasejump/react". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]

Minimum Reproduction:

  1. npm create vite
  2. select react, typescript + swc
  3. npm install @usebasejump/react
  4. npm install
  5. add an import to App.tsx - import { usePersonalAccount } from "@usebasejump/react";
  6. then just use it so the the bundler grabs it, you don't need to get a Supabase client or anything set up first as an argument, it doesn't matter for this error - const personalAccount = usePersonalAccount();
  7. npm run dev, experience error.

I tried figuring this issue out with the package, but wasn't quite able to. I ended up just taking the hooks and types and placing directly in my repo and it all works great for now in the meantime. Thanks for making this project, it's a huge timesaver.

@hankmander
Copy link

I encountered this issue too when Remix 2.7.0 switched to Vite. I put up a pull request for it, but in the mean time @whithr you could just update your package.json dependencies to:
"@usebasejump/react": "npm:hankmander-usebasejump-react@^0.0.7",
Which is what i did to quickly get past this.

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