Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: Can't find variable: RegExpPrototypeExec, require('tty').WriteStream.prototype.getColorDepth() #5465

Closed
magicdawn opened this issue Sep 15, 2023 · 2 comments · Fixed by #5468
Labels
bug Something isn't working

Comments

@magicdawn
Copy link

What version of Bun is running?

1.0.1

What platform is your computer?

Darwin 21.6.0 x86_64 i386

What steps can reproduce the bug?

image

executed in macOS iTerm2, and process.env.TERM => 'xterm-256color'

  1. bunx bun-repl
  2. exec var t = require('tty')
  3. exec t.WriteStream.prototype.getColorDepth()

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

this method is used in the npm module clipanion

function getDefaultColorDepth() {
--
12 | if (tty__default['default'] && `getColorDepth` in tty__default['default'].WriteStream.prototype)
13 | return tty__default['default'].WriteStream.prototype.getColorDepth();
14 | if (process.env.FORCE_COLOR === `0`)
15 | return 1;
16 | if (process.env.FORCE_COLOR === `1`)
17 | return 8;
18 | if (typeof process.stdout !== `undefined` && process.stdout.isTTY)
19 | return 8;
20 | return 1;
21 | }
@magicdawn magicdawn added the bug Something isn't working label Sep 15, 2023
@Jarred-Sumner
Copy link
Collaborator

thats what we get for not using TypeScript

@magicdawn
Copy link
Author

Jarred-Sumner added a commit that referenced this issue Sep 15, 2023
Jarred-Sumner added a commit that referenced this issue Sep 15, 2023
* Fixes #5465

Fixes #5465

* Update tty.js

* Update InternalModuleRegistryConstants.h

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
paperdave pushed a commit to SuperAuguste/bun that referenced this issue Sep 18, 2023
* Fixes oven-sh#5465

Fixes oven-sh#5465

* Update tty.js

* Update InternalModuleRegistryConstants.h

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants