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

Type confusion #761

Closed
FlatMapIO opened this issue Mar 19, 2024 · 1 comment
Closed

Type confusion #761

FlatMapIO opened this issue Mar 19, 2024 · 1 comment

Comments

@FlatMapIO
Copy link

FlatMapIO commented Mar 19, 2024

When add vitest-environment-miniflare into project, the web api was contaminated with types under @types/node, calls like response.json() had type problems, I had to explicitly import { fetch } from '@cloudflare/workers-types to solve the problem, I wonder why miniflare didn't use @cloudflare/workers-types ?

@mrbbot
Copy link
Contributor

mrbbot commented Mar 19, 2024

Hey! 👋 Make sure you're including vitest-environment-miniflare/globals in your tsconfig.json's types field. See https://legacy.miniflare.dev/testing/vitest#setup for more details. We recently announced support for a new Workers Vitest integration using Miniflare 3 and workerd. I'd encourage you to switch to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants