jsdom / whatwg-url

An implementation of the WHATWG URL Standard in JavaScript
https://jsdom.github.io/whatwg-url/
MIT License
371 stars 94 forks source link

import TextEncoder and TextDecoder #226

Closed LeoSpencer closed 2 years ago

LeoSpencer commented 2 years ago

When run at node server display "TextEncoder is not defined", that's imports fix this issue.

domenic commented 2 years ago

See closed PRs and issues. Upgrade your Node.

tommysusanto commented 2 years ago

This is still not working I've updated node to LTS.

andreas4all commented 2 years ago

Hi @domenic what version Node do you mean? In package.json is defined minimal 12, but this not working on 12, 14, 16 and 18 (all LTS version). What I need to upgrade???

domenic commented 2 years ago

If you put the following into a file test.js:

const whatwgURL = require("whawg-url");

and do node --version and get Node 18, and then do node test.js and get an error, I would love to learn more. However, that is not what we have observed across many test machines (including the continuous integration test suite that runs on every commit).