TypeScript error when using builtin onlyViewActions
middleware
#911
Labels
bug
M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
semver:minor
TypeScript-specific
Milestone
Description
When calling
onlyViewActions
method like this:I receive the following error:
Here's the full error log:
But this wouldn't make sense, since
args
could be within these unions.Also, the following snippet works perfectly - which indicates that could indeed be something wrong with the builtin middleware:
Are these middlewares internal? Should I be using them on production code or not?
Please let me know if I'm doing something wrong, but from what I could tell, I think that's pretty much how these builtin middlewares should be used:
AnyMiddlewareArgs & AllMiddlewareArgs
to themonlyActions
definition below):bolt-js/src/middleware/builtin.ts
Lines 36 to 45 in 9867e38
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 3.3.0
node version: 15.8.0
OS version(s): Linux 5.11.16-arch1-1
Steps to reproduce:
onlyActions
middleware;args
as argument, whereargs
is of typeAnyMiddlewareArgs & AllMiddlewareArgs
;Expected result:
The middleware should work and check the types properly.
Actual result:
A Typescript error was displayed.
The text was updated successfully, but these errors were encountered: