cloudflare / cloudflare/templates

🐛 BUG: Missing @types/node for worker

Open
#771 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.1k
Forks
1k
Avg merge
17h 44m
Merged PRs (30d)
10

Description

### Which template does this pertain to?

vite-react-template

### What versions are you using?

^4.32.0 [Wrangler]

### What operating system and version are you using?

Universal

### Please provide a link to a minimal reproduction (optional)

_No response_

### Describe the Bug

In this template's [tsconfig.worker.json](https://github.com/cloudflare/templates/blob/fb15f225f4c15690ad32a79f2990887896dbb2f0/vite-react-template/tsconfig.worker.json#L5), the `types` field should include `"node"` in the array.
See docs regarding the `type` config: https://www.typescriptlang.org/tsconfig/#types

Even more the case since `node_js_compat` is enabled in [wrangler.json](https://github.com/cloudflare/templates/blob/fb15f225f4c15690ad32a79f2990887896dbb2f0/vite-react-template/wrangler.json#L6) and `@types/node` installed as a [dev dependency](https://github.com/cloudflare/templates/blob/fb15f225f4c15690ad32a79f2990887896dbb2f0/vite-react-template/package.json#L25)

### Please provide any relevant error logs

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.