Skip to content
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

Module import doesn't work if absolute search path is given to FileResolver. Is this expected. #365

Open
navneetankur opened this issue Sep 27, 2024 · 0 comments

Comments

@navneetankur
Copy link

navneetankur commented Sep 27, 2024

FileResolver::default()
        .with_paths(
            ["/home/someuser/modules", "./"]
        ).with_native();

The above file resolver is unable to find the module libfs.so present in "/home/someuser/modules". Imported by import { something } from "fs"; It's because it converts the given absolute path to relative. Is this expected.

let path = path.join_normalized(name);

The above join_normalized converts "/home/someuser/modules" to "home/someuser/modules".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant