Skip to content

Cannot import root module #611

@TomzBench

Description

@TomzBench

Environment details

os: linux
node-pty: 1.0.0
node: 18.16.1
typescript: 5.1.3

Issue description

Does not work

import pty from "node-pty"

pty.spawn(/* ... */); // Error:  spawn does not exist on type "undefined"

Works

import {spawn} from "node-pty";

spawn(/* ... */); // works

Not sure if this is operator error and im doing something dumb, or maybe the .t.ds file does not match what is expected. in either case the docs don't show how to import so perhaps this is then this issue is more a recommendation to add some notes on the usage in the docs

(Since it compiles via typescript, but fails on runtime with undefined error, it might be a typescript declaration file issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions