You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the Fastify plugin in an ESM Fastify app results in a Typescript build error.
src/plugins/graphql/index.ts:147:28 - error TS2769: No overload matches this call.
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ path: string; baseURL: string; endpointURL: string; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'typeof import("/.../node_modules/.pnpm/[email protected][email protected]/node_modules/altair-fastify-plugin/dist/index")' is not assignable to parameter of type 'FastifyPluginCallback<{ path: string; baseURL: string; endpointURL: string; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Expected Behavior
The plugin should be able to be used with ESM enabled.
Steps To Reproduce
Set "type": "module" in your package.json and add typescript support.
import AltairFastify from 'altair-fastify-plugin';
import Fastify from 'fastify';
const app = Fastify();
app.register(AltairFastify);
Fastify has fixed their plugins using the "infamous triplet" with module.exports (fastify/fastify#4349). Ideally it can be applied to this plugin so it supports both CJS/ESM seamlessly.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current Behavior
Using the Fastify plugin in an ESM Fastify app results in a Typescript build error.
Expected Behavior
The plugin should be able to be used with ESM enabled.
Steps To Reproduce
Set "type": "module" in your package.json and add typescript support.
Environment
Additional context
Fastify has fixed their plugins using the "infamous triplet" with module.exports (fastify/fastify#4349). Ideally it can be applied to this plugin so it supports both CJS/ESM seamlessly.
The text was updated successfully, but these errors were encountered: