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

TypeError: Cannot read properties of undefined (reading 'description') #1385

Open
omk42 opened this issue May 22, 2024 · 1 comment
Open
Labels
bug Something isn't working pinned don't close this just for being stale

Comments

@omk42
Copy link

omk42 commented May 22, 2024

Bug severity
2

Describe the bug
My agent's open-api route fails because of TypeError: Cannot read properties of undefined (reading 'description'). I manually compared the agent.availableMethods() and agent.getSchema().components.methods.keys() and they look similar. Note that veramo server CLI command is able to fetch open-api schema for the same agent.

To Reproduce
Steps to reproduce the behaviour:

  1. Agent
  export const agent = createAgent<IDIDManager & IKeyManager & IDataStore & IDataStoreORM & IResolver & ICredentialPlugin>({...})
  1. remote setup
const exposedMethods = agent.availableMethods()

const schemaRouter = ApiSchemaRouter({
  basePath,
  exposedMethods,
});

const app = express();
app.use(basePath, requestAgentRouter, agentRouter);
app.use(schemaPath, requestAgentRouter, schemaRouter);

Observed behaviour
Stack trace at basepath/open-api.json

TypeError: Cannot read properties of undefined (reading 'description')
    at getOpenApiSchema (@veramo/remote-client/src/openApi.ts:34:61)
    at node_modules/@veramo/remote-server/src/api-schema-router.ts:52:29
    at Layer.handle [as handle_request] (node_modules/express/lib/router/layer.js:95:5)
    at next (node_modules/express/lib/router/route.js:149:13)
    at Route.dispatch (/node_modules/express/lib/router/route.js:119:3)
    at Layer.handle [as handle_request] (node_modules/express/lib/router/layer.js:95:5)
    at node_modules/express/lib/router/index.js:284:15
    at Function.process_params (/node_modules/express/lib/router/index.js:346:12)
    at next (node_modules/express/lib/router/index.js:280:10)
    at Function.handle (/node_modules/express/lib/router/index.js:175:3)

Expected behaviour
Same as veramo sever CLI

Versions (please complete the following information):

  • Veramo: ^6.0.0
  • veramo remote server "^5.6.0"
  • Browser chrome
  • Node v18.17.1
@omk42 omk42 added the bug Something isn't working label May 22, 2024
@mirceanis mirceanis added the pinned don't close this just for being stale label Jul 11, 2024
@mirceanis
Copy link
Member

seems related to #1379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned don't close this just for being stale
Projects
None yet
Development

No branches or pull requests

2 participants