A
arktypeβ€’6d ago
PIat

Ark attest cannot find module error

Hello! In a pnpm monorepo, with @ark/attest installed in the workspace root and running pnpx run attest trace ., I get the following output:
...
Found & ignored ...
...
Starting: attest trace .
Debugger listening on ws://127.0.0.1:43611/c9521cad-1760-4b47-aa82-6525ed118c96
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
node:internal/modules/cjs/loader:1148
throw err;
^

Error: Cannot find module '/home/p/Documents/Projects/web/attest'
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
...
Found & ignored ...
...
Starting: attest trace .
Debugger listening on ws://127.0.0.1:43611/c9521cad-1760-4b47-aa82-6525ed118c96
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
node:internal/modules/cjs/loader:1148
throw err;
^

Error: Cannot find module '/home/p/Documents/Projects/web/attest'
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
What should I change to run it without issues?
103 Replies
ssalbdivad
ssalbdivadβ€’6d ago
Well it looks like you're running from cjs so you'll need to add "type": "module" to your package.json It looks like from the stack trace attest's code is never executed
PIat
PIatβ€’6d ago
Even with type module in the root package json it's giving the same error
ssalbdivad
ssalbdivadβ€’6d ago
Try adding more context without all the ... I can't really see what's happening from that
PIat
PIatβ€’6d ago
Are there any changes I need to make to the code itself? Maybe I didn't understand the docs?
ssalbdivad
ssalbdivadβ€’6d ago
No haha You just install the package and run that command you can tell it is not even running attest's code Wait did you run pnpm attest trace? Or just attest trace npm installing something doesn't put it on your path Depending whether you're using npm/pnpm/yarn whatever just run it using that
PIat
PIatβ€’6d ago
pnpm attest trace . and pnpx attest trace . throw the same error
ssalbdivad
ssalbdivadβ€’6d ago
Show the whole output "Starting: attest trace ."
Starting: attest trace .
...
Error: Cannot find module '/home/p/Documents/Projects/web/attest'
This seems kinda sus
PIat
PIatβ€’6d ago
> pnpx run attest trace .


Watching /home/p/Documents/Projects/web and all sub-directories not excluded by your .gitignore. Will not monitor dotfiles.
Found & ignored ./.cache ; is listed in .gitignore
Found & ignored ./.turbo ; is listed in .gitignore

Starting: attest trace .
Debugger listening on ws://127.0.0.1:46625/06faf203-653b-4ac4-8960-6569e4784fce
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
node:internal/modules/cjs/loader:1148
throw err;
^

Error: Cannot find module '/home/p/Documents/Projects/web/attest'
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
> pnpx run attest trace .


Watching /home/p/Documents/Projects/web and all sub-directories not excluded by your .gitignore. Will not monitor dotfiles.
Found & ignored ./.cache ; is listed in .gitignore
Found & ignored ./.turbo ; is listed in .gitignore

Starting: attest trace .
Debugger listening on ws://127.0.0.1:46625/06faf203-653b-4ac4-8960-6569e4784fce
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
node:internal/modules/cjs/loader:1148
throw err;
^

Error: Cannot find module '/home/p/Documents/Projects/web/attest'
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
ssalbdivad
ssalbdivadβ€’6d ago
That somehow it is not actually being resolved through node_modules
PIat
PIatβ€’6d ago
Should I hoist it?
ssalbdivad
ssalbdivadβ€’6d ago
No lol I mean I don't know what's going on but I don't just have some random fix this is not a normal issue it seems like something with your env Most attest users use pnpm like this So it doesn't just not work haha What isthe output for just pnpm attest trace .
PIat
PIatβ€’6d ago
The help section +
Error: Command failed: pnpm tsc --noEmit --extendedDiagnostics --incremental false --tsBuildInfoFile null --generateTrace /home/p/Documents/Projects/web/.attest/trace
⏳ Analyzing type trace data for ....
Error: Command failed: pnpm tsc --noEmit --extendedDiagnostics --incremental false --tsBuildInfoFile null --generateTrace /home/p/Documents/Projects/web/.attest/trace
⏳ Analyzing type trace data for ....
ssalbdivad
ssalbdivadβ€’6d ago
Just paste the whole thing Including the command and all output
PIat
PIatβ€’6d ago
ssalbdivad
ssalbdivadβ€’6d ago
okay maybe I just broke it with the release yesterday then because I just changed how ts aliases are loaded It worked for me locally but maybe something externally breaks
Want results from more Discord servers?
Add your server