nodejs / import-in-the-middle

Like `require-in-the-middle`, but for ESM import
https://www.npmjs.com/package/import-in-the-middle
Apache License 2.0
72 stars 27 forks source link

Fix hook in node 16.17.0 #21

Closed uurien closed 2 years ago

uurien commented 2 years ago

file:node:something was a invalid url and the last node v16.17.0 version throws an error if the URL is not valid.

uurien commented 2 years ago

Can this be tested? Since it causes a crash, we should definitely make sure that the issue is actually fixed and won't come back.

Yes, I've added a build for 16.17.0 to prevent it from breaking again

Also, it looks like the issue is with Node 16.17 but this focuses only on major versions. How is the original issue addressed?

Yes, the issue is with node 16.17. But the fix doesn't break the solution with other versions. Node 16.17.0 starts to do some checks with the url and it doesn't support file:node:async_hooks like url.