"ReferenceError: URL is not defined" when OAuth 1.0 is in use
iovecoldpizza opened this issue · comments
Environment:
Node v8.17.0 & MeteorJS v1.8.1
Brief situation:
When using OAuth to construct a client (in my case I'm accessing Jira server, instead of Jira cloud) and use it to call any APIs, "ReferenceError: URL is not defined" got thrown.
As a side note OAuth2 connection toward Jira cloud works out of the box.
Steps to reproduce:
- Use OAuth to construct either a Version2Client or Version3Client (Jira Server is used for my case )
- Make any API calls
- "ReferenceError: URL is not defined" will be thrown.
Possible fix:
As suggested by the error message, the URL package is not being imported in /out/services/authenticationService/authentications/createOAuthAuthenticationToken.js
. (I'm not sure if it's imported by default in newer Node versions)
Adding const URL = require("url").URL
in the file will fix the issue.
p.s. Thanks for the package btw. It saves tons of time constructing raw HTTP requests :)
Hi @AK4702! Thank you for your question. Actually I’m using whatwg URL that was added in NodeJS v10.0.0. And also NodeJS v10.0.0 it is a minimal support verison