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

Hangs while react is trying to connect to react dev tools / not exiting #648

Open
bn-l opened this issue Mar 8, 2024 · 0 comments
Open

Comments

@bn-l
Copy link

bn-l commented Mar 8, 2024

Ink (via react) will hang as it tries to connect to dev tools.

Currently ink will try and load react dev tools if the env var "DEV" is set to "true" (note: not NODE_ENV or INK_ENV--which makes it easy to accidentally have this flag flipped).

If dev tools is not installed (it's an optional peer dependency) then ink will crash (with, imo, an uninformative message).

If it is installed and react cannot find the dev tools server (or whatever), then it will begin retrying using an exponential back up. As a result ink will very likely either hang or crash.

I'm a little surprised there isn't an issue already on this in particular.

My fix for this is the following:

  const test = async() => {
      
      const saved = process.env["DEV"];
      process.env["DEV"] = "false";
      const tui = await import("./inkTUI.mjs");
      process.env["DEV"] = saved;
      return tui;
  };
  const tui = await test();

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant