You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/index.js b/index.js
index 33778b5539b7fcd7a1e99474a4ecb1745fdfe508..2bbe4cab025553db0814aba2a333d615e9d335e8 100644
--- a/index.js
+++ b/index.js
@@ -9,9 +9,12 @@ module.exports = inquire;
*/
function inquire(moduleName) {
try {
- var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
+ var mod = require(moduleName);
if (mod && (mod.length || Object.keys(mod).length))
return mod;
+ // var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
+ // if (mod && (mod.length || Object.keys(mod).length))
+ // return mod;
} catch (e) {} // eslint-disable-line no-empty
return null;
}
bun build ./spannertest.ts --compile --outfile dist/new
Running ./dist/new works fine when run from the project directory (because node_modules is still in a parent folder & has google-gax inside of it). When I move new to a new directory, I get this error:
$ ./new
error: Cannot find package 'google-gax' from '/$bunfs/root/new'
What is the expected behavior?
google-gax should be bundled inside of a single file executable. It doesn't seem like it's dynamically imported from @google-cloud/spanner, so unclear why it's not being included as it's a nested dependency.
What do you see instead?
After moving the binary to a new dir w/out node_modules in a parent dir:
error: Cannot find package 'google-gax' from '/$bunfs/root/new'
Additional information
I was wondering two things:
Is it possible to debug the bunfs filesystem in a single-file-executable? Not the embeddedFiles which I know there exists a helper for, the entire file system & see why google-gax is not included.
How can I fix this error? I tried directly importing google-gax import * as _ggax from "google-gax"; and that doesn't work. I can build ./dist/new then move it, then do a bun install google-gax in the new directory and that works, but that defeats the purpose of a single file executable.
The text was updated successfully, but these errors were encountered:
What version of Bun is running?
1.2.10
What platform is your computer?
Darwin 24.5.0 arm64 arm
What steps can reproduce the bug?
I'm trying to get the spanner client
@google-cloud/spanner
working with a single file executable. Example code is here:spannertest.ts
:Building works fine after applying a patch for protobufjs:
./patches/@protobufjs%[email protected]
:Running
./dist/new
works fine when run from the project directory (because node_modules is still in a parent folder & has google-gax inside of it). When I move new to a new directory, I get this error:What is the expected behavior?
google-gax should be bundled inside of a single file executable. It doesn't seem like it's dynamically imported from
@google-cloud/spanner
, so unclear why it's not being included as it's a nested dependency.What do you see instead?
After moving the binary to a new dir w/out node_modules in a parent dir:
Additional information
I was wondering two things:
import * as _ggax from "google-gax";
and that doesn't work. I can build ./dist/new then move it, then do abun install google-gax
in the new directory and that works, but that defeats the purpose of a single file executable.The text was updated successfully, but these errors were encountered: