-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Native Dependency loading Error for package sqlite-vec
#8824
Comments
So electron-builder doesn't change the paths of what is being imported or even modify your app/bundled code, electron-builder is a packager and not a bundler.
That's because it's loading everything from the filesystem, so yeah, that'll work. Packaged apps are self-contained, so your issue is likely a local misconfiguration. The fact that electron-builder doesn't return an error during packaging confirms it's behaving correctly. Please provide a minimum reproducible repo, because as it currently stands, there's not much I can do to help with the current info provided. |
I have created this repo which reproduces the error. Can't tell you how much it would mean if you help to fix this!! |
So I added some console logging to the packages being loaded.
And here:
The logs returned the correct values.
I dove a little deeper and found this:
It seems that by default, it'll search for the path you provide So the error message re: "vec0.dylib.dylib" is kind of confusing as what I think it's really trying to say is that it can't find |
That actually really valuable input, I think one of the issues is related to this path I don't really know what asar but I assume the error has something to do with that |
https://github.com/Laurin-Notemann/reproduce-sql-error I this line here where it hardcodes the path to use app.asar.unpack instead of app.asar. which solves the error, obvs thats just a patchwork fix |
The root issue lies in sqlite-vec's path resolution using import.meta.url. When running in an Electron app, import.meta.url returns a virtual path inside the asar archive (which is a file, not a directory), causing the package to look for the native module in the wrong location. The package needs to be updated to handle Electron's asar packaging system by checking if it's running in a packaged Electron environment and using the correct path to app.asar.unpacked instead. This affects any Electron application using sqlite-vec with native modules packaged in asar archives. |
sqlite-vec
Why does it try to open
vec0.dylib.dylib
when onlyvec0.dylib
exsits???SQLite Vec Extension Loading Error on macOS - vec0.dylib.dylib not found
Description
When launching the Electron app on macOS, it fails to initialize due to an error loading the SQLite vector extension. The error occurs when trying to load the
vec0.dylib.dylib
file from thesqlite-vec-darwin-arm64
package.Everything works well in development Environment and the
npm run build && electron-builder --mac --arm64
command runs without error the error occurs while opening the app.Error Message
Environment
Current Configuration
electron-builder.json configuration for unpacking native modules:
Expected Behavior
The application should successfully load the SQLite vector extension (from AppName.app/Contents/Resources/app.asar/node_modules/sqlite-vec-darwin-arm64/vec0.dylib) and initialize the database.
Actual Behavior
The application fails to start due to being unable to load the SQLite extension from within the asar archive because it tries to load from AppName.app/Contents/Resources/app.asar/node_modules/sqlite-vec-darwin-arm64/vec0.dylib.dylib.
The text was updated successfully, but these errors were encountered: