Skip to content

import.meta.resolve(Sync) should not throw error when module file cannot be found #8928

Closed as not planned
@lotus128

Description

@lotus128

What version of Bun is running?

1.0.26+c75e768a6

What platform is your computer?

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

Using import.meta.resolve or import.meta.resolveSync for a module which does not exist will throw an error.

console.log(import.meta.resolveSync("./render.png"));

What is the expected behavior?

I expect the behavior/ implementation of import.meta.resolve to be compatible with the specification, and make no attempt to access the path.

What do you see instead?

import.meta.resolve throws an error instead.

error: Cannot find module "./render.png" from ...

Additional information

My goal is to determine the path of a file which does not yet exist and to write some asset to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions