-
Notifications
You must be signed in to change notification settings - Fork 140
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
BUG: node-fetch/https.get doesn't work (Socket hang up) #7
Comments
This is supposed to work. Bug confirmed. Thanks for reporting 🙏 |
This is probably caused by the browser rejecting the request because of CORS reasons. From the linked Blitz above, https://stackblitz.com/edit/node-zfkjjc?file=index.js, I get this in my console before the hangup message comes:
Something very similar happens in our Node ORM Prisma, which needs to download a binary from a server to work: prisma/prisma#7185 |
You can unblock yourself by installing for example this Chrome extension: https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf?hl=en |
Like @janpio said, this issue happens cause it's not possible to call the url from the browser's env, which is where WebContainer is running. See an example here: https://stackblitz.com/edit/typescript-ive2dd. You need to make sure this call works, and then the v2 project should also work. |
name: Bug report
about: https://stackblitz.com/edit/node-zfkjjc?file=index.js
title: 'BUG: node-fetch/https.get doesn't work (Socket hang up)'
labels: 'http, socket, networking'
assignees: ''
Describe the bug
Unable to load remote data via node-fetch (or https module).
Link to the blitz that caused the error
https://stackblitz.com/edit/node-zfkjjc?file=index.js
Expected behavior
A clear and concise description of what you expected to happen.
Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2
Desktop (please complete the following information):
Browser name = Brave
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 56890553,
usedJSHeapSize: 50431077,
jsHeapSizeLimit: 4294705152
}
The text was updated successfully, but these errors were encountered: