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

Statically import libsql targets #89

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

msanchezdev
Copy link

I am not sure if there are more targets, but developing with bun using the single-file executable mode the libsql driver fails to be imported from the embedded file system as Bun doesn't detect what files are to be imported if done dynamically.

As the code dynamically imports the proper target module we can get a false positive if the built file is run in a project that has the node_modules/@libsql/* target folders so it's recommended to test this by copying the binary file to another directory or simply running it from somewhere else:

e.g:
image

Image Error Transcript:

error: Cannot find module "@libsql/linux-x64-gnu" from "/$bunfs/root/test-build"

@msanchezdev msanchezdev marked this pull request as draft March 11, 2024 12:31
@penberg
Copy link
Contributor

penberg commented Mar 11, 2024

Oh, nice @msanchezdev! Does it mean we can drop the @neon-rs/load dependency too?

@msanchezdev
Copy link
Author

msanchezdev commented Mar 11, 2024

@penberg I wasn't sure about neon, have to check how it works, but I am trying another approach now as this way it actually seems to be bundling all into the binary

@giovannibenussi
Copy link
Contributor

Hey, there are any updates regarding this? It would be nice to drop the @neon-rs/load dependency!

@penberg penberg force-pushed the main branch 3 times, most recently from 3dd2f0a to 4a3f0cc Compare June 17, 2024 06:51
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

Successfully merging this pull request may close these issues.

4 participants