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

Headers is not defined when fetch #1093

Closed
1 task done
kecrily opened this issue Jun 2, 2023 · 2 comments
Closed
1 task done

Headers is not defined when fetch #1093

kecrily opened this issue Jun 2, 2023 · 2 comments

Comments

@kecrily
Copy link

kecrily commented Jun 2, 2023

Describe the bug

When I run node index.js, throw a error:

Error: Headers is not defined
    at async ESMLoader.import (https://httpsstackblitzwebcontainerapi-xmpu.w-corp.staticblitz.com/blitz.e0a2bd6c.js:35:1312908)
    at async i.loadESM (https://httpsstackblitzwebcontainerapi-xmpu.w-corp.staticblitz.com/blitz.e0a2bd6c.js:35:315880)
    at async handleMainPromise (https://httpsstackblitzwebcontainerapi-xmpu.w-corp.staticblitz.com/blitz.e0a2bd6c.js:35:1079787)

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-with-terminal-g5jtqs?file=files.js

Steps to reproduce

  1. Run pnpm i && node index.js in Terminal

Expected behavior

Normal output fetch results

Parity with Local

Screenshots

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 113

Additional context

No response

@thescientist13
Copy link

I think #560 is being used a top level tracking issue for Node 18 support in WebContainers (including fetch and friends), so might be worth following along there.

@Nemikolh
Copy link
Member

Nemikolh commented Jun 9, 2023

Hi @kecrily !

@thescientist13 is correct. This does not work because we currently only support node version v16.4.2 where Headers is not defined.

@Nemikolh Nemikolh closed this as completed Jun 9, 2023
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

No branches or pull requests

3 participants