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

Module not found: Can't resolve 'y-supabase' #4

Open
elbracht opened this issue Mar 23, 2023 · 2 comments
Open

Module not found: Can't resolve 'y-supabase' #4

elbracht opened this issue Mar 23, 2023 · 2 comments

Comments

@elbracht
Copy link

I don't know exactly what is wrong here but I can't import the npm package.

import SupabaseProvider from 'y-supabase';

I only get the error message

Module not found: Can't resolve 'y-supabase'

The folder y-supabase exists in node_modules and also has an index file in dist

@benjaminpreiss
Copy link

I think it is the wrong main field in the package.json file... Fixed it by:

diff --git a/package.json b/package.json
index 0e95de4a5d5f63ff3da84ea97a90fe177a89acad..9c4d9fe69df582f39361cc24163b5aa5415f9135 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
   "version": "0.0.4-7-alpha",
   "description": "Sync Yjs over supabase",
   "sideEffects": false,
-  "main": "src/y-supabase.js",
+  "main": "dist/index.js",
   "types": "dist/index.d.ts",
   "files": [
     "dist/**/*"

@benjaminpreiss
Copy link

Pull request fixing this: #5

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