Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript/ES6 module instructions #8

Closed
wants to merge 1 commit into from

Conversation

mikemaccana
Copy link
Contributor

@mikemaccana mikemaccana commented Aug 27, 2020

Checklist

  • run npm run test and npm run benchmark
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message and code follows Code of conduct

### As a TypeScript / ES6 module

```js
import { FastifyInstance as Fastify } from "fastify";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This throws an error to me:

import { FastifyInstance as Fastify } from 'fastify'
         ^^^^^^^^^^^^^^^
SyntaxError: The requested module 'fastify' does not provide an export named 'FastifyInstance'

Meanwhile import Fastify from 'fastify' works.

(I used node --experimental-modules try.mjs with node 12.x)

What was your setup?

@Eomm
Copy link
Owner

Eomm commented May 31, 2022

Supersedes by #25

@Eomm Eomm closed this May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants