Giter Site home page Giter Site logo

Comments (5)

jonnydgreen avatar jonnydgreen commented on June 5, 2024 2

Only thing seems I have not mentioned is setting up the type to module in the packages.json

Ah yep, that triggered the issue!

I believe I've figured it out: the mercurius index.d.ts is not nodenext compatible, so this will require a fix that would include a small refactor of the index.d.ts file. For example, the following changes to index.d.ts would resolve the issue:

type Mercurius = FastifyPluginCallback<mercurius.MercuriusOptions>

declare namespace mercurius {
  // ...
  
  export const mercurius: Mercurius
  export { mercurius as default }
}

declare module "fastify" {
  // ...
}

declare function mercurius(...params: Parameters<Mercurius>): ReturnType<Mercurius>
export = mercurius;

wdyt @mcollina ?

from mercurius.

jonnydgreen avatar jonnydgreen commented on June 5, 2024 2

Yep, absolutely! I'll get that done this week :)

from mercurius.

jonnydgreen avatar jonnydgreen commented on June 5, 2024

Hey @iamchathu ! I was unable to replicate the issue using the instructions you provided, are you able to provide a link to a GH repo or your full package.json+package-lock.json for closer inspection? :)

from mercurius.

iamchathu avatar iamchathu commented on June 5, 2024

@jonnydgreen Please refer here. https://github.com/iamchathu/mercurius-ts-example

Only thing seems I have not mentioned is setting up the type to module in the packages.json

from mercurius.

mcollina avatar mcollina commented on June 5, 2024

That would be perfect. Can you send a PR?

from mercurius.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.