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

ANSI colors break gatsby develop output on Linux #29293

Closed
Mithgarthsormr opened this issue Feb 1, 2021 · 12 comments · Fixed by #29472
Closed

ANSI colors break gatsby develop output on Linux #29293

Mithgarthsormr opened this issue Feb 1, 2021 · 12 comments · Fixed by #29472
Assignees
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: cli Related to the Gatsby CLI type: bug An issue or pull request relating to a bug in Gatsby

Comments

@Mithgarthsormr
Copy link

Mithgarthsormr commented Feb 1, 2021

Hello,
I've got a problem with gatsby develop. In November it worked properly but now the output on the console seems wrong (as you see on the screenshot).
Bildschirmfoto von 2021-02-01 17-57-36

Steps to reproduce:

  1. Set up a new gatsby page, I've used this instruction to make sure the page is minimal: https://www.gatsbyjs.com/docs/using-gatsby-professionally/setting-up-gatsby-without-gatsby-new/
  2. try gatsby develop, it will work this time
  3. Add a minimal gatsby-config.js file like this:
    module.exports = {
    plugins: [
    ],
    }
  4. try gatsby develop again, the outcome should be the same as on the screenshot.

The development mode itself does work, but the logging on the console doesn't.

By the way, I'm working on Ubuntu 20.04 if this makes a difference.

edit:
Using an existing git repo seems to trigger this issue, too. Without the git repo it now seems to work after updating gatsby-cli, But after I clone a git repo it doesn't.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 1, 2021
@ishan-biztech
Copy link

ishan-biztech commented Feb 2, 2021

Same issue with me. I'm converting an existing application from create-react-app to gatsby, but seems like output is not showing in console, whereas when navigating to http://localhost:8000/, the site works fine.

gatsby-console-output-not-showing

In addition, there's also few 404 errors showing in console "GET http://localhost:8000/page-data/404.html/page-data.json"

P.S. I'm on Ubuntu 20.04.1 LTS

@LekoArts LekoArts added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. topic: cli Related to the Gatsby CLI and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Feb 3, 2021
@LekoArts
Copy link
Contributor

LekoArts commented Feb 3, 2021

I can't reproduce this on my terminals on Windows, WSL or Mac. If you use the mouse to highlight text, do you see any text?

2021_02_03_233e316b

Maybe your CLI colors are set up incorrectly. Anyways, we'll need more information on how to reproduce this.

@Mithgarthsormr
Copy link
Author

Nope, still nothing.
gatsby_screenshot

@ascorbic
Copy link
Contributor

Could you try disabling colors like so:

FORCE_COLOR=0 gatsby develop

@ishan-biztech
Copy link

Thanks @ascorbic, that worked for me. Do you know the issue? Will it be fixed in next release?

@Mithgarthsormr
Copy link
Author

Mithgarthsormr commented Feb 11, 2021

@ascorbic: Thanks a lot, this worked for me, too!

@ascorbic
Copy link
Contributor

Great! No, this isn't a known issue, so we would need to work out the cause. Could you both share details of your platform, terminal etc and if you have cusotm terminal fonts for example

@ascorbic ascorbic changed the title gatsby develop not working properly with gatsby-config.js ANSI colors break gatsby develop output in Ubuntu Feb 11, 2021
@Mithgarthsormr
Copy link
Author

This is the current project I'm working on, but the problem happened with much less packages. With an older git repo combined with a new gatsby page, it happened even with an empty gatsby-config.js file.

System:
OS: Linux 5.8 Ubuntu 20.04.2 LTS (Focal Fossa)
CPU: (4) x64 Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
npm: 6.14.11 - ~/.nvm/versions/node/v12.18.3/bin/npm
Browsers:
Firefox: 85.0.1
npmPackages:
gatsby: ^2.32.3 => 2.32.3
gatsby-image: ^2.11.0 => 2.11.0
gatsby-plugin-manifest: ^2.12.0 => 2.12.0
gatsby-plugin-material-ui: ^2.1.10 => 2.1.10
gatsby-plugin-matomo: ^0.9.0 => 0.9.0
gatsby-plugin-mdx: ^1.10.0 => 1.10.0
gatsby-plugin-offline: ^3.10.0 => 3.10.0
gatsby-plugin-page-creator: ^2.10.0 => 2.10.0
gatsby-plugin-react-helmet: ^3.10.0 => 3.10.0
gatsby-plugin-sass: ^3.2.0 => 3.2.0
gatsby-plugin-sharp: ^2.14.1 => 2.14.1
gatsby-source-filesystem: ^2.11.0 => 2.11.0
gatsby-transformer-sharp: ^2.12.0 => 2.12.0
npmGlobalPackages:
gatsby-cli: 2.19.1
gatsby: 2.31.1

@aaronkai
Copy link

I'm seeing this error as well.

I'm not in ubuntu, but Fedora 33. Regular gterm terminal. I am using oh-my-zsh and custom terminal font MesloLGS NF with zsh theme ZSH_THEME="powerlevel10k/powerlevel10k"

Running FORCE_COLOR=0 gatsby develop worked for me.

@ascorbic ascorbic changed the title ANSI colors break gatsby develop output in Ubuntu ANSI colors break gatsby develop output on Linux Feb 11, 2021
@pieh
Copy link
Contributor

pieh commented Feb 11, 2021

I could repro on ubuntu in virtual machine:
Screenshot 2021-02-11 at 22 52 04

As a temporary workaround you can use GATSBY_LOGGER=yurnalist gatsby develop (that logger seem unaffected):
Screenshot 2021-02-11 at 22 52 22

It seems to be caused by usage of terminal-link here in combination with our default logger (ink) in some terminals

message += ` · (${terminalLink(`Umbrella Issue`, flag.umbrellaIssue)})`

Will remove the use of terminal-link tomorrow - it's not critical to have nice links that it produces if it cause issues like that in some terminals

@pieh pieh self-assigned this Feb 12, 2021
@pieh pieh added status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby and removed status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. labels Feb 12, 2021
@Mithgarthsormr
Copy link
Author

@pieh: Thanks a lot! This should do until the bug is fixed!

@ascorbic
Copy link
Contributor

Fixed in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: cli Related to the Gatsby CLI type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants