Multer is missing for config.d.ts
See original GitHub issueconfig.d.ts
references multer
but it’s not included/referenced in tsoa runtime, causing an error message.
p_1 | $ rm -rf /build && tsoa spec-and-routes && tsc
p_1 | node_modules/@tsoa/runtime/dist/config.d.ts(2,39): error TS2307: Cannot find module 'multer' or its corresponding type declarations.
Nevertheless, I can still access my OpenAPI spec and SwaggerUI. I am not using any form/multi endpoints from the spec, that might be why it still works. Also I cannot say how a real API would be affected, currently this is just a few mock controllers to produce a spec.
Sorting
-
I’m submitting a …
- bug report
- feature request
- support request
-
I confirm that I
- used the search to make sure that a similar issue hasn’t already been submit
Expected Behavior
No error when running tsoa in docker container / building docker image. Peer dependency is shipped / declared correctly (?)
Current Behavior
When running tsoa spec-and-routes
I see this message:
p_1 | $ rm -rf /build && tsoa spec-and-routes && tsc
p_1 | node_modules/@tsoa/runtime/dist/config.d.ts(2,39): error TS2307: Cannot find module 'multer' or its corresponding type declarations.
Nevertheless, I can still access my OpenAPI spec and SwaggerUI. I am not using any form/multi endpoints from the spec, that might be why it still works. Also I cannot say how a real API would be affected, currently this is just a few mock controllers to produce a spec.
Note: I only see the message when calling tsoa during a Docker image build, but when going into node_modules/@tsoa/.../config.d.ts
VS code is also claiming that multer
is missing.
Adding multer
as dev dependency gets rid of the warning in the logs and in VS code, but it feels strange that I have to add the dependency explicitly to my project.
Possible Solution
Steps to Reproduce
If needed, I can provide more details and a small repro later on.
Context (Environment)
Version of the library: 3.14.1 and 4.0.0-rc1 Version of NodeJS: 16 (LTS, Alpine Image as base for Docker image)
- Confirm you were using yarn not npm: [x]
Issue Analytics
- State:
- Created a year ago
- Reactions:9
- Comments:9
Top GitHub Comments
this appears to also be present in
4.0.0
- with the temporary fix being the addition ofmulter
as a dependency (though as mentioned, somewhat unexpected behavior).I also encountered this bug with tsoa 4.1.0. I was not using docker, but still unable to tun
yarn run tsc --outDir build --experimentalDecorators
due to the error. manually installing multer and @types/multer as dev dependencies fixed the problem.