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

Bundled build error on Windows #1758

Open
damms005 opened this issue Feb 2, 2024 · 4 comments
Open

Bundled build error on Windows #1758

damms005 opened this issue Feb 2, 2024 · 4 comments
Labels

Comments

@damms005
Copy link

damms005 commented Feb 2, 2024

Issue Summary

I develop and build my VS Code extension on my Linux machine.

It uses sqlite3 to connect to SQLite databases.

However, some Windows users have node error that the node sqlite3 build is not a valid Win32 application

image

Details in this issue: damms005/devdb-vscode#46

I build and deploy the code from my Linux machine.

How do I address this please?

Steps to Reproduce

  1. Download the extension from the marketplace
  2. Install a new Laravel appliation
  3. Open the Laravel application codebase on a Mac OS machine
  4. Open the extension view
  5. See the error

Version

5.1.7

Node.js Version

v20.3.0

How did you install the library?

Bundled in the extension as explained in teh steps above

@damms005 damms005 added the bug label Feb 2, 2024
@CodingBear-Git
Copy link

@damms005
Hello! I also encountered this. This error occurs because you are developing on a PC running Linux. When you run the npm install sqlite3 command, a build only for Linux OS is installed in the \node_modules\sqlite3\lib\binding directory.
For me, the solution was to manually download builds (here: https://github.com/TryGhost/node-sqlite3/releases/tag/v5.1.6) for other OS (windows for example) and upload them here: \node_modules\sqlite3\ lib\binding
For example:
\node_modules\sqlite3\lib\binding\napi-v6-linux-musl-x64
\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64

But this solution only works for version 5.1.6 and below. This doesn't work in version 5.1.7. I created an issue about this here #1754

I hope I helped somehow, good luck!

@damms005
Copy link
Author

damms005 commented Feb 9, 2024

Thanks for the clarification, @CodingBear-Git. I thought as much, but I do not have any proof or read about it anywhere.

Two questions:

  1. Per the manual download you explained, does it mean you were downloading binaries in code at runtime?
  2. Do you think this cross-platform compatibility is what @lovell is talking about here: How does asaar work in Electron for Sharp? lovell/sharp#3985 (comment) ?

@CodingBear-Git
Copy link

@damms005

  1. I have a node js application. I'm using https://github.com/vercel/pkg to make a binary file (For example, .exe for Windows). When I create a binary, my node_modules directory is included in the file. And inside node_modules there are already sqlite3 assemblies for all the systems that I support.
  2. I think not, but I'm not sure. I don't have much experience :)

@damms005
Copy link
Author

Thanks for your detailed response, @CodingBear-Git .

Per #1754, it seems you are also having this cross-platform issue.

I also evidently do not have very deep experience with Node.js.

However, it seems @lovell's comment that I posted above is a likely way out and I will update you here if I find anything worthwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants