Skip to content

Problems when using the examples that include an schema as a middleware #96

Closed
darkxeno opened this issue Apr 28, 2020 · 1 comment
Closed

Comments

@darkxeno
Copy link

I am getting the following errors:

(node:46753) UnhandledPromiseRejectionWarning: TypeError: schema is not a function
    at uWS.HttpResponse.send (/Users/c.fernandez.traba/Development/Projects/Online%20Coaching%20API/plans/node_modules/nanoexpress/build/nanoexpress.js:866:18)
    at /Users/c.fernandez.traba/Development/Projects/Online%20Coaching%20API/plans/node_modules/nanoexpress/build/nanoexpress.js:1779:20
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

when trying to use the following examples:

https://github.com/nanoexpress/nanoexpress/blob/master/examples/swagger-ui.js
https://github.com/nanoexpress/nanoexpress/blob/master/examples/schema.js

But probably the same is happening for any example where the schemas are set directly as a MW.

I am using node 14.0.0 but i have the same errors under node 10.16.0 and nanoexpress 2.0.1.

Is this documentation up to date: https://nanoexpress.js.org/schemas. ?

Thanks

@dalisoft
Copy link
Member

dalisoft commented May 8, 2020

@darkxeno Thanks for bug-report.
Please check latest version and let me know it works or not

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants