web-infra-dev / nodejs_resolver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't deal with priority correctlly

tjx666 opened this issue · comments

package.json:

{
    "name": "commonjs",
    "exports": {
        "./a/b/*": "./dist/hello.js",
        "./a/*/c": null
    }
}

output:

thread '' panicked at 'internal error: entered unreachable code', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/nodejs-resolver-0.0.34/src/map.rs:135:18
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
[1] 8437 abort node apps/commonjs-app/index.js

image

enhanced-resolve used by webpack works:

image

commented

Thanks for your feedback, probably because I forgot to handle null https://github.com/web-infra-dev/nodejs_resolver/blob/main/src/map.rs#L118

btw, node binding is using a lower version and may have many bugs that have been fixed