Closed RafaelGSS closed 4 years ago
OK the issue is related to the fact that the code compiles as fastify_plugin_1["default"](examplePlugin)
and there is not exported default prop here https://github.com/fastify/fastify-plugin/blob/master/plugin.js#L125
To fix this is enough to add plugin.default = plugin
before module.exports = plugin
.
🐛 Bug Report
fastify-plugin
+fastify
on typescript not work as expected. I understand the problem when this doc was created: https://github.com/fastify/fastify-plugin#known-issue-typescript-contextual-inference, but following the examples not works as well. I created a reproduction code https://github.com/RafaelGSS/fastify-fp-types.To Reproduce
https://github.com/RafaelGSS/fastify-fp-types
Expected behavior
Not throw an error on runtime because of the wrong transpilation
Your Environment