Closed ilteoood closed 1 week ago
I see the same behaviour even when I try to analyze glob in another project.
Could it be related to the format of the export
field? AFAIK is valid, don't know why oxc doesn't recognize it.
let path = PathBuf::from_str(format!("{}/packages/node_modules/@node-red/util/lib/i18n.js"), node_red_clone_path).unwrap();
This needs to be a directory, not a file.
@Boshen I've changed by test to match the following:
#[test]
fn test_resolve_cjs() {
let node_red_clone_path = "/path/to/cloned/node-red";
let resolver = Resolver::new(ResolveOptions::default());
let result = resolver.resolve(PathBuf::from_str(node_red_clone_path).unwrap(), "i18next");
assert!(result.is_ok(), "failed to resolve: {:?}", result);
}
But the error is still the same:
failed to resolve: Err(PackagePathNotExported(".", "/Users/ilteoood/Documents/git/personal/node-red/node_modules/i18next/package.json"))
But the files are actually there:
To make it work, I have to change the resolver configuration as follows:
let resolver = Resolver::new(ResolveOptions {
exports_fields: vec![],
imports_fields: vec![],
..Default::default()
});
The error message is burried in the README 😅
https://github.com/oxc-project/oxc-resolver/blob/main/README.md#errors--trouble-shooting
Hi, I'm facing an issue while using
oxc-resolver
, version 1.12.0, to resolve all the dependencies of the node-red.To reproduce it, please follow these steps:
run the following test on a rust project that has oxc-resolver installed:
I expect it to be resolved correctly, like NodeJS does, but instead the following error is returned:
The content of the message is:
Am I missing something in the configuration in order to make it behave like node?