You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from pocking around (in node 14), it seems like we can't properly clean what requires it, a safer approach would be to skip the module whose child is a .node and all its childrens to prevent breaking anything to weirdly.
// Remove all descendants from cache as wellif(require.cache[filePath]){const{ children }=require.cache[filePath];letisSafe=true;for(const{ id }ofchildren){if(id.endsWith('.node')){isSafe=false;}}if(isSafe){deleterequire.cache[filePath];for(const{ id }ofchildren){clear(id);}}}
I don't know if that would impact anyone else's usage.
Hey we've been using this module a bit, and I've encountered an issue with it.
It seems you don't filter out native module, and as per nodejs documentation this causes bad behavior when re-requiring code later on.
This documentation as been added there : nodejs/node@5c14d69
To reproduce, clear-module and reimport any library that internally uses a native library ( '.node' file )
I'm getting an
Error: Unknown failure
when requiring it back and more specifically when the codes tries to call a function (that's within the .node )The text was updated successfully, but these errors were encountered: