basejump icon indicating copy to clipboard operation
basejump copied to clipboard

Package issue with vite/react causes build error

Open whithr opened this issue 1 year ago • 1 comments

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.

whithr avatar Feb 21 '24 17:02 whithr