Skip to content

nodeInternals() does not include matchers for node:  #54

Closed
@SimenB

Description

@SimenB
const StackUtils = require('stack-utils');

const stack = new StackUtils();

const cleaned = stack.clean(`
    at ChannelWrap.emitInitNative (internal/async_hooks.js:136:43)
    at new Resolver (internal/dns/utils.js:23:20)
    at internal/dns/utils.js:101:23
    at NativeModule.compile (internal/bootstrap/loaders.js:285:5)
    at nativeModuleRequire (internal/bootstrap/loaders.js:192:14)
    at dns.js:38:5
    at NativeModule.compile (internal/bootstrap/loaders.js:285:5)
    at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:220:8)
    at loadNativeModule (internal/modules/cjs/helpers.js:23:9)
    at Function.Module._load (internal/modules/cjs/loader.js:694:15)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
`);

console.log(cleaned);

Expected result:

''

Received result:

processTicksAndRejections (node:internal/process/task_queues:93:5)

Workaround:

const stack =  new StackUtils({
  internals: StackUtils.nodeInternals().concat(/\s*\(node:/);
});

nodejs/node#35498

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions