Skip to content

ReferenceError: Cannot access uninitialized variable. #7263

@redpandatronicsuk

Description

@redpandatronicsuk

What version of Bun is running?

1.0.13+f5bf67bd1

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

Create the file foo.ts with contents:

const Infinity = 1/0;

then run bun foo.ts and it will exit and print this error:

ReferenceError: Cannot access uninitialized variable.

What is the expected behavior?

No crash

What do you see instead?

Crash

Additional information

The line const Infinity = 1/0; is used in the @ltd/j-toml package and when that package is imported it crashes when run with bun.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtranspilerparser || printer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions