-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The resolve process does not report an error when the only main field of the packagejson points to a non-existent file. #162
Comments
terminal now running 1 test
test tests::test_resolver_package_json_bad_main ... ok
successes:
---- tests::test_resolver_package_json_bad_main stdout ----
res->
Resolution {
path: "/Users/jason.zhu/Desktop/rs-test/resovler/test_package_json_bad_main/node_modules/demo-pkg/index.js",
query: None,
fragment: None,
package_json: Some(
"/Users/jason.zhu/Desktop/rs-test/resovler/test_package_json_bad_main/node_modules/demo-pkg/package.json",
),
}
successes:
tests::test_resolver_package_json_bad_main
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s expect throw a panic |
This comment was marked as spam.
This comment was marked as spam.
@zhusjfaker you've been asked to not |
cjs
esm ( oxc-resolver's behaviour is correct according to both algorithms specified in
When you say it's incorrect, please base evidence from the specification instead speculating, to save us some time. Thank you. |
sorry |
I understand, sorry for the intrusion, but oxc-resolver looks inconsistent with esbuild-resolver in some places so far. I need to go back to rolldown to discuss this, and the next time I submit an isuee, I will strictly refer to esm to ensure that the tests are comprehensive before submitting the correct isuee. |
Please report the expected result if this is the case. |
sorry i got misstake , The current results are correct |
When the only main field of the packagejson points to a non-existent file, the resolve process does not report an error and continues to look for 'index.js' by default.
rust code case:
https://github.com/zhusjfaker/oxc-resolver-has-issue-in-esbuild-test-case-packagejson-2002b/blob/fix/main_fields_not_resolve_case/tests/mod.rs#L29
rust repo and branch:
https://github.com/zhusjfaker/oxc-resolver-has-issue-in-esbuild-test-case-packagejson-2002b/tree/fix/main_fields_not_resolve_case
cmd:
cargo test
The text was updated successfully, but these errors were encountered: