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

Cryptic error message on "setup-only" service. #285

Closed
HatiGamedev opened this issue Mar 29, 2016 · 2 comments
Closed

Cryptic error message on "setup-only" service. #285

HatiGamedev opened this issue Mar 29, 2016 · 2 comments
Labels
Milestone

Comments

@HatiGamedev
Copy link

Just noticed if you create a service with only a Service#setup(...) function and app.use(...) it.
You get a cryptic error message ( my guess - it's coming from express ), "Router.use() requires middleware function but got a Object".

Example:

// Error
const SomeService = {
    setup(app, path) {}
}
​
// No Error
​
const AnoterService = {
    setup(app, path) {},
    create(data, params, cb) {}
}
​
​
app.use('/some', SomeService); // cryptic error
app.use('/another', AnotherService); // Fine
@ekryski
Copy link
Contributor

ekryski commented Mar 31, 2016

@HatiEth great bug report! Thank you. This is cryptic. This might stay open for a bit but we'll definitely address this.

@lock
Copy link

lock bot commented Feb 7, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants