Closed aquiladev closed 5 years ago
At first sight simply replacing url.URL with URL and not explicitly importing the url package seems to work fine. Is there any reason this could break stuff elsewhere?
does not work in my case
removing the import of url const url = require('url')
works (node v10.15.1)
/util.js
/**
* Wait for the specified time.
*
* @param {Number} time Interval duration [ms].
* @return {Promise} Resolves after the specified delay.
*/
exports.timer = async time =>
new Promise(resolve => setTimeout(resolve, time))
exports.joinUrl = (base, path) => {
const u = new URL(path, base)
return u.href
}
I put in another PR which I think fixes the issue, see #105 #106.
The problem occurs because url.URL
is undefined
(read more in this comment).
I have an error on application startup when I import armlet package
$ npm -v 6.4.1 $ node -v v10.15.1