question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'schemaName' of undefined

See original GitHub issue

Hi there. I keep running into this error when trying to startup my application. I’ve looked for help in Google, with no luck. Unfortunately i can’t share much of the code, but here’s the stacktrace:

[18:18:32.087] 47383 NOTE     api/layout/List — Generating List endpoint for layout
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api — Error: TypeError: Cannot read property 'schemaName' of undefined
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at Object.generateJoiModelFromFieldType (/var/www/private/node_modules/rest-hapi/utilities/joi-mongoose-helper.js:213:27)
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at /var/www/private/node_modules/rest-hapi/utilities/rest-helper-factory.js:169:46
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at arrayEach (/var/www/private/node_modules/rest-hapi/node_modules/lodash/index.js:1289:13)
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at Function.<anonymous> (/var/www/private/node_modules/rest-hapi/node_modules/lodash/index.js:3345:13)
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at Object.generateListEndpoint (/var/www/private/node_modules/rest-hapi/utilities/rest-helper-factory.js:168:11)
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at Object.generateRoutes (/var/www/private/node_modules/rest-hapi/utilities/rest-helper-factory.js:51:16)
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at /var/www/private/node_modules/rest-hapi/rest-hapi.js:92:36
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at process.nextTick (/var/www/private/node_modules/hapi/node_modules/hoek/lib/index.js:858:22)
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at _combinedTickCallback (internal/process/next_tick.js:73:7)
[18:18:32.093] 47383 ERROR    node_modules/rest-hapi/utilities/rest-helper-factory.js:98:16 api —     at process._tickCallback (internal/process/next_tick.js:104:9)

Tell me if you need more details. I’m using the latest version of rest-hapi. Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
duartealexfcommented, Aug 18, 2017

Thanks @JKHeadley, I used the first solution and it worked.

I also found another way to fix it:

cols: {
    type: Array,
    default: []
}
0reactions
JKHeadleycommented, Aug 17, 2017

yes, it is due to the empty cols array. If you assign a type to the array, it should fix that, for example:

cols: [Types.String]

or even

cols: [{}]

should work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'schema' of undefined #1200
I am trying to create an update autoform. I have tried to pass the document as a template helper and local data context, ......
Read more >
express-openapi-validator: ERROR: TypeError: Cannot read ...
I have a openapi schema definition like this:
Read more >
TypeError: Cannot read property 'schema' of undefined
Hello, i want to write some Values in a Influx Database (V1.8) If i send this, it works: { "_msgid": "add6566.b6dd4a8", ...
Read more >
TypeError: Cannot read property 'schema' of undefined
I get this error while validating this swagger file. According to swagger-cli, this file is valid and I cannot understand the reason.
Read more >
TypeError: Cannot read property 'validate' of undefined? - React
“Cannot read property 'validate' of undefined”? Anyone can help in finding the error. ... Is there any more to that error? For example...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found