Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to use node.js url module on angular 7

I want to import the node.js url module (the native) but i keep getting errors on the browser.

This is how im importing:

import * as url from 'url';

This is the error that i get when trying to use some of the package classes:

url__WEBPACK_IMPORTED_MODULE_3__.URLSearchParams is not a constructor

Im also getting the "url" constant as undefined.

as far as i know Angular CLI uses webpack which should import without any problem the package, but it doesn`t

Comments