Skip to content

Commit 2ee8506

Browse files
committed
fix: Allow importing when using a SEA binary
testBindingBinary would throw when using a node-llama-cpp in a SEA binary. Add an exclusion to getShouldTestBinaryBeforeLoading to check for this and skip the test.
1 parent 1799127 commit 2ee8506

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bindings/getLlama.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import process from "process";
22
import path from "path";
3+
import sea from "node:sea";
34
import console from "console";
45
import {createRequire} from "module";
56
import {
@@ -914,6 +915,9 @@ function getShouldTestBinaryBeforeLoading({
914915
platformInfo: BinaryPlatformInfo,
915916
buildMetadata: BuildMetadataFile
916917
}) {
918+
if (sea.isSea()) {
919+
return false;
920+
}
917921
if (platform === "linux") {
918922
if (isPrebuiltBinary)
919923
return true;

0 commit comments

Comments
 (0)