-
Notifications
You must be signed in to change notification settings - Fork 33
Binary execution fails on local dependencies #43
Comments
Hi @m0ar, Thanks for using caxa and for reaching out. caxa preserves symlinks. For example, suppose your project looks like the following:
{
"type": "module",
"dependencies": {
"caxa": "^2.1.0"
}
}
import fs from "node:fs/promises";
import path from "node:path";
import url from "node:url";
console.log(
await fs.readFile(
path.join(url.fileURLToPath(import.meta.url), "../symlink"),
"utf-8"
)
); $ echo Hello > original
$ ln -s original symlink Then you package it with caxa: $ npx caxa --input . --output example -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/index.js" And run the executable: $ ./example
Hello So unfortunately there’s something else about your infrastructure that’s going wrong. Maybe it might help you to check the contents of $ node -p "require(\"os\").tmpdir()" Good luck and feel free to reopen the issue in case you think there’s something we can do to help. |
OK, that's great to know! This information will definitely help with the debugging :) |
Hi @m0ar, Could you find a solution, I have a similar issue where my local dependencies are not included in the package. |
@erdemert nope, wasn't a good fit for our use case. We have embraced Nix instead :) |
I have been trying to package an application from our monorepo with caxa, but it's failing on all local/path dependencies.
We have a couple of dependencies declared like this:
The resulting namespace in
node_modules
is populated with symlinks:The resulting error when executing with
ts-node
:I would suspect caxa does not follow symlinks when including bundling the dependencies.
The text was updated successfully, but these errors were encountered: