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

Miniflare type definitions do not export things like Request #258

Closed
ajwootto opened this issue May 12, 2022 · 3 comments
Closed

Miniflare type definitions do not export things like Request #258

ajwootto opened this issue May 12, 2022 · 3 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@ajwootto
Copy link
Contributor

In the Miniflare examples there's a code snippet that imports Request from the miniflare package:
https://miniflare.dev/core/fetch#dispatching-events

This was working fine in the Miniflare 1.x version I was using, but upon updating to version 2.4 it seems the type definition no longer includes the Request (and other things like Response) leading to an error like this in Typescript:
image

I am able to import them directly from @miniflare/core however,
import { Request, Response } from '@miniflare/core'

@mrbbot
Copy link
Contributor

mrbbot commented May 20, 2022

Hey! 👋 Thanks for raising this. As you note, the correct thing to do here is import Response from @miniflare/core. Didn't realise there were still examples using Miniflare 1's imports. Will get this fixed soon. 👍

@mrbbot mrbbot added bug Something isn't working documentation Improvements or additions to documentation labels May 20, 2022
@mrbbot mrbbot closed this as completed in 4a3f509 May 27, 2022
@mrbbot
Copy link
Contributor

mrbbot commented May 27, 2022

Hey! I've just released version 2.5.0 with a fix for this. Request, Response and RequestInfo/RequestInit types are now exported from miniflare. Please let me know if you have any other issues.

@ajwootto
Copy link
Contributor Author

Thanks @mrbbot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants