Invalid Middlewares Value
Invalid Middlewares Value
This error occurs if you mis-configure the MetroJS client when adding one or more middleware modules.
The correct way to add a single middleware module is:
However, often you will need to pass some options to the middleware as well. In that case, the middleware should provide a factory function, that takes those options and returns a middleware function:
You can also add a middleware function directly to the client factory method, e.g:
Finally, you can add a set of middleware functions in the options parameter:
Note: the middlewares param must be an array of functions.