10000 Environment Detection does not work with JS ES Modules · Issue #253 · ajalt/mordant · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Environment Detection does not work with JS ES Modules #253
Open
@robertfmurdock

Description

@robertfmurdock

When this module is used as a dependency in a project that uses the setting "compilerOptions { target = "es2015" }", suddenly environment variables aren't available to the application via MultiplatformSystem.readEnvironmentVariable.

It looks like when the JS code tries to determine the environment, it uses a raw 'require'. I believe this is causing an error when inside of an mjs context, causing the system to assume its running in a browser context, even though it is not.

Discovered this after switching a project based on Clikt to use ESM.

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

      0