0.4 to 0.5 error - Cannot read property 'description' of undefined
(node:88018) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'description' of undefined
at resolveDescription (/Users/carlosrj/Workspace/SpaceX Land/api/node_modules/sofa-api/src/open-api/operations.ts:176:44)
at Object.buildPathFromOperation (/Users/carlosrj/Workspace/SpaceX Land/api/node_modules/sofa-api/src/open-api/operations.ts:29:23)
at Object.addRoute (/Users/carlosrj/Workspace/SpaceX Land/api/node_modules/sofa-api/src/open-api/index.ts:62:56)
at Object.onRoute (/Users/carlosrj/Workspace/SpaceX Land/api/src/servers/rest.ts:24:17)
at Object.keys.forEach.fieldName (/Users/carlosrj/Workspace/SpaceX Land/api/node_modules/sofa-api/src/express.ts:34:14)
at Array.forEach (<anonymous>)
at Object.createRouter (/Users/carlosrj/Workspace/SpaceX Land/api/node_modules/sofa-api/src/express.ts:30:40)
at Object.useSofa (/Users/carlosrj/Workspace/SpaceX Land/api/node_modules/sofa-api/src/index.ts:9:10)
at Object.exports.default (/Users/carlosrj/Workspace/SpaceX Land/api/src/servers/rest.ts:20:9)
at /Users/carlosrj/Workspace/SpaceX Land/api/src/index.ts:19:7
Im having the same issue after upgrading:
TypeError: Cannot read property 'map' of undefined
at resolveVariable (/node_modules/sofa-api/dist/parse.js:32:22)
The issue doesn't occur on my original version of [email protected]
Hi @kamilkisiela !
For information my error seems to be almost the same, I've tried your fix just pushed and still not working for me.
Version 0.4.0 working well
Using ts-node version 8.4.1, typescript version 3.6.3
TypeError: Cannot read property 'fields' of undefined
at resolveDescription (/Users/jeremy.morin/Workspace/public-api/node_modules/sofa-api/src/open-api/operations.ts:173:36)
at Object.buildPathFromOperation (/Users/jeremy.morin/Workspace/public-api/node_modules/sofa-api/src/open-api/operations.ts:29:23)
at Object.addRoute (/Users/jeremy.morin/Workspace/public-api/node_modules/sofa-api/src/open-api/index.ts:62:56)
at Object.onRoute (/Users/jeremy.morin/Workspace/public-api/src/index.ts:156:21)
at /Users/jeremy.morin/Workspace/public-api/node_modules/sofa-api/src/express.ts:34:14
at Array.forEach (<anonymous>)
at Object.createRouter (/Users/jeremy.morin/Workspace/public-api/node_modules/sofa-api/src/express.ts:30:40)
at Object.useSofa (/Users/jeremy.morin/Workspace/public-api/node_modules/sofa-api/src/index.ts:9:10)
at Object.<anonymous> (/Users/jeremy.morin/Workspace/public-api/src/index.ts:111:5)
at Module._compile (internal/modules/cjs/loader.js:945:30)
@Jermorin could you share the schema or even a small reproduction?
Hi !
Yes of course : https://github.com/Jermorin/repro-sofa-issue
From : https://github.com/prisma/prisma-examples/tree/master/typescript/graphql-auth
🍺 Cheers
#169 this one SHOULD fix it :) I tested it on your
@kamilkisiela I upgraded to 0.5.1 and I still have the same error as when using the rest endpoint.. TypeError: Cannot read property 'map' of undefined at resolveVariable (.../sofa-api/dist/parse.js:32:22)
The issue doesn't happen when using a graphql request, only rest.
@tatianafrank We haven't released the new version that has this fix yet :)
@kamilkisiela Thanks guy for this fix, hope to see that releasing soon 👍
ok thanks
thanks @kamilkisiela!
v0.6.0