Skip to content

Conversation

rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Jun 17, 2025

🎯 Problem Solved

Pyodide HTTPS requests were failing with URLError: <urlopen error unknown url type: https> and urllib3 requiring experimental WebAssembly flags:

Connection aborted.', HTTPException('urllib3 only works in Node.js with pyodide.runPythonAsync and requires the flag --experimental-wasm-stack-switching in versions of node <24.

This blocked essential functionality like pandas.read_csv() with HTTPS URLs and requests library usage.

🚀 Solution

Upgrade Node.js requirement to v24+ which provides native WebAssembly stack switching support, eliminating the need for experimental flags.

✅ What Now Works

All HTTPS operations in Python notebooks:

# Direct pandas HTTPS reading - now works!
df = pd.read_csv('https://docs.google.com/spreadsheets/d/abc123/export?format=csv')

# requests library HTTPS - works!
import requests
response = requests.get('https://api.example.com/data')

# urllib3 HTTPS - works!
import urllib3
http = urllib3.PoolManager()
resp = http.request('GET', 'https://httpbin.org/json')

## Context

Node.js v24 includes native WebAssembly JavaScript Promise Integration (JSPI) and stack switching support that Pyodide relies on for proper networking. Previous versions required `--experimental-wasm-stack-switching` flag.

This change aligns with Pyodide's official recommendations and modern JavaScript runtime capabilities.

rgbkrk added 2 commits June 16, 2025 21:24
…port

- Update package.json engines to require Node.js >=24.0.0
- Update testing documentation to reflect v24 requirement
- Add Prerequisites section to README explaining Node.js v24 requirement
- Node.js v24 provides native WebAssembly stack switching for Pyodide HTTPS without experimental flags
Node.js v24+ enables full HTTPS support in Pyodide including:
- requests library HTTPS requests
- pandas.read_csv with HTTPS URLs
- urllib3 direct HTTPS access

All tested and working without experimental flags.
@rgbkrk
Copy link
Member Author

rgbkrk commented Jun 17, 2025

Eh. This doesn't always work. Switching to Deno tomorrow.

@rgbkrk rgbkrk closed this Jun 17, 2025
@rgbkrk rgbkrk deleted the nodejs-v24-upgrade branch June 17, 2025 04:41
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

Successfully merging this pull request may close these issues.

1 participant