sindresorhus/normalize-url

[3.x] Incompatible with Microsoft Edge

Closed this issue · 2 comments

When I invoke normalizeUrl(...) on Microsoft edge, I get the following error:

TypeError: Unable to get property 'keys' of undefined or null reference

I believe this is caused by the following line:

for (const key of [...urlObj.searchParams.keys()]) {

Downgrading to 2.0.1 is my temporary work-around for the issue.

You can target properly the library transpiling it using babel

This module mainly targets Node.js, not the browser. It's up to you to transpile it with Babel if you want to use it in the browser. You can find a more detailed explanation here: sindresorhus/ama#446

If you use Webpack, check out babel-engine-plugin, which transpiles only the dependencies that needs to be transpiled.