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

Only works on node 10 or later #48

Closed
bramevo opened this issue Jul 15, 2020 · 2 comments
Closed

Only works on node 10 or later #48

bramevo opened this issue Jul 15, 2020 · 2 comments
Assignees

Comments

@bramevo
Copy link

bramevo commented Jul 15, 2020

Apparently it only works starting from node v10

ReferenceError: URL is not defined
at Promise (..../node_modules/dohjs/lib/index.js:175:5)

@kimbo
Copy link
Contributor

kimbo commented Jul 15, 2020

Correct, URL is only globally defined in node 10+. The fix for that is to add something like var URL = require('url').URL at the top of the page. I tried that before (see 6889d9a) but for some reason it broke things and so I reverted the change (see b5529b9). Don't remember what the exact issue was.

I'll take a look at it sometime in the next few days.

@bramevo
Copy link
Author

bramevo commented Jul 15, 2020

Or you could add a warning in the README. Or a specific branch that has the require line for older versions.

@kimbo kimbo closed this as completed in 1f5dc41 Jul 16, 2020
kimbo added a commit that referenced this issue Dec 3, 2021
support node8 by including require('url').URL (fix #48, fix #42)
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

2 participants