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

Unable to do Cross-Platform compilation #1815

Open
WinterWolf98 opened this issue Jan 6, 2025 · 0 comments
Open

Unable to do Cross-Platform compilation #1815

WinterWolf98 opened this issue Jan 6, 2025 · 0 comments

Comments

@WinterWolf98
Copy link

Issue Summary

I've been testing my application with MacOS, but when I try to deploy my application in a cloud function which is running on linux and x64 architecture I'm getting the invalid ELF header error.

I've tried the following

  1. Installing with --os linux --cpu x64 options
  2. Rebuild with --os linux --cpu x64 options
  3. Installing with --build-from-source --os linux --cpu x64 options

but there's seems to be no change. Even when I try to test the application after running the above install/rebuild commands the application works fine in local machine (MacOS), and when I deploy the same to cloud functions it doesn't work and throws the invalid ELF header error.

The same works perfectly fine when I install the sqlite3 package from a linux machine and deploy it to the cloud function.

Am I missing something here when trying to install the package specific to an OS ?

Relevant logs or output

Error: /catalyst/node_modules/sqlite3/build/Release/node_sqlite3.node: invalid ELF header
at Module._extensions..node (node:internal/modules/cjs/loader:1454:18)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at bindings (/catalyst/node_modules/bindings/bindings.js:112:48)
at Object. (/catalyst/node_modules/sqlite3/lib/sqlite3-binding.js:1:37)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object. (/catalyst/node_modules/sqlite3/lib/sqlite3.js:2:17)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object. (/catalyst/sql-test.js:1:17)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object. (/catalyst/index.js:4:20)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at cjsLoader (node:internal/modules/esm/translators:348:17)
at ModuleWrap. (node:internal/modules/esm/translators:297:7)
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async FlavourHandler.loadCustomerCode (file:///var/runtime/flavours/index.js:71:46)
at async CUSTOMER_ROUTE (file:///var/runtime/index.js:110:13) {
code: 'ERR_DLOPEN_FAILED'
}

Version

5.1.7

Node.js Version

v20.16.0

How did you install the library?

npm install

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

No branches or pull requests

1 participant