Skip to content

typescript doc bug change "import fastify from 'fastify'" to "import { fastify } from 'fastify'" #4241

@mortifia

Description

@mortifia

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.5.3

Plugin version

x.x.x

Node.js version

16.16.0

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

win 11 ( insider )

Description

ts(2349) with current importl in doc when i call "fastify()"

Steps to Reproduce

npm init -y
npm i fastify
npm i -D typescript @types/node
{
  "compilerOptions": {
    ..., //ect
    "target": "ESNext",
    "esModuleInterop": true,
    ..., //ect
  }
}
import fastify from 'fastify'

const server = fastify()

server.get('/ping', async (request, reply) => {
  return 'pong\n'
})

server.listen({ port: 8080 }, (err, address) => {
  if (err) {
    console.error(err)
    process.exit(1)
  }
  console.log(`Server listening at ${address}`)
})

Expected Behavior

no ts(2349) when following example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions