redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.36k stars 1k forks source link

[Bug?]: Command line gets all fuzzy when an error is thrown #9117

Open rapzo opened 1 year ago

rapzo commented 1 year ago

What's not working?

When an error is thrown generating something via command line, like a scaffold, the prompt gets fuzzy until the next generator runs successfully: image

The effect is kept even out of the redwood command-line context: image

How do we reproduce the bug?

Probably it has something to do with my OS configuration, but one way of reproducing is:

What's your environment? (If it applies)

System:
    OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 18.17.1 - /tmp/xfs-d40e2289/node
    Yarn: 3.6.1 - /tmp/xfs-d40e2289/yarn
  Databases:
    SQLite: 3.39.2 - /home/rui/Android/Sdk/platform-tools/sqlite3
  Browsers:
    Chrome: 116.0.5845.140
  npmPackages:
    @redwoodjs/auth-dbauth-setup: 6.1.0 => 6.1.0 
    @redwoodjs/auth-firebase-setup: 6.1.0 => 6.1.0 
    @redwoodjs/core: 6.1.0 => 6.1.0 
    @redwoodjs/eslint-config: ^6.1.0 => 6.1.0 
    @redwoodjs/eslint-plugin: ^6.1.0 => 6.1.0

Are you interested in working on this?

rapzo commented 1 year ago

I think the faulty code is here: https://github.com/redwoodjs/redwood/blob/00d0d5d0246d2fcb24a97a768f8d3d2655427b8c/packages/internal/src/generate/graphqlSchema.ts#L68-L101 Because it should be rendering a link after See the as in L95 on the link above, but it rendered the error instead, with the link formatting, and the terminal gets messed up. But I'll try to dig more into this.

To note that this is on a standard VS Code integrated terminal.

jtoar commented 1 year ago

Hey @rapzo I can reproduce this in the VS Code terminal. Are you still interested in working on this one? And anything I can do to help if so?

rapzo commented 1 year ago

Last few days haven't been able to look into this, but i intend to during the week. Next step is to debug that flow, i suppose. Tried to replicate with something like this https://gist.github.com/rapzo/aa175a9af7126e247af25befabaf503d But all behaves as expected, so it kind of throws out the chance of being a terminal-link or VS Code issue. Let me know if you have any suggestion on how to tackle this. Thanks.

rapzo commented 1 year ago

It's definitely that link, although it might not be neither the lib nor redwood's. My latest digging got me looking into listr2