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

ao spawn is passing undefined as module #1002

Open
av1ctor opened this issue Sep 5, 2024 · 3 comments
Open

ao spawn is passing undefined as module #1002

av1ctor opened this issue Sep 5, 2024 · 3 comments
Labels
cli ao CLI

Comments

@av1ctor
Copy link

av1ctor commented Sep 5, 2024

Version 0.1.3

When running spawn, the env var MODULE_TX is passed as undefined to the Docker container.

Maybe at

export async function spawn ({ wallet, tag, value, source }) {
the "source" field should be actually "module" (the ao CLI's argument name)?

ao spawn --module SOME_MODULE_TX -w ../arweave-keyfile.json

node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^

Error: Invalid Arguments '0': Required.
at errFrom (file:///opt/node/node_modules/@permaweb/aoconnect/dist/index.js:383:9)
at file:///opt/node/node_modules/@permaweb/aoconnect/dist/index.js:17:18
at file:///opt/node/node_modules/@permaweb/aoconnect/dist/index.js:17:14
at file:///opt/node/node_modules/@permaweb/aoconnect/dist/index.js:17:14ZodError: [
{
"code": "invalid_arguments",
"argumentsError": {
"issues": [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
0
],
"message": "Required"
}
],
"name": "ZodError"
},
"path": [],
"message": "Invalid function arguments"
}
]
at file:///opt/node/node_modules/zod/lib/index.mjs:3166:31
at Object.fork (file:///opt/node/node_modules/@permaweb/aoconnect/dist/index.js:39:17)
at file:///opt/node/node_modules/@permaweb/aoconnect/dist/index.js:21:61

Node.js v18.17.0

@av1ctor
Copy link
Author

av1ctor commented Sep 5, 2024

Adding the screenshot from Docker Desktop, showing MODULE_TX=undefined.

image

@TillaTheHun0
Copy link
Member

We'll need to look into this. Most ao builders are using aos to spawn their own modules that extend aos.

You can also use aoconnect to spawn a process from a module.

@av1ctor
Copy link
Author

av1ctor commented Sep 5, 2024

@TillaTheHun0, thanks again!

I opened the PR #1005 to fix this issue.

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

No branches or pull requests

2 participants