Skip to content

require('./local_script.js'); not working #5

Description

@leaf-node

Worker scripts are able to require() builtin modules and those in the local node_modules directory, but they cannot require files specified with a relative path such as ./local_script.js.

I also noticed that the __filename variable is not defined in worker scripts.

I would like worker scripts to require files relative to the directory of the worker scripts themselves, not relative to the directory of the running program's source file, any third party libraries that load workers with tiny-workers, or the working directory. Such behavior seems to be aligned with nodejs style require() functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions