这是indexloc提供的服务,不要输入任何密码
Skip to content

debug.js not working under turbo. It logs nothing  #453

@denik1981

Description

@denik1981

What version of Turborepo are you using?

1.0.23

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Linux

Describe the Bug

I'm not being able to use debug with turbo.

None of the messages that debug emmits are picked up by turbo, nor shown in the terminal.
I set process.env.DEBUG to * to pick up everything, not just my app, but dependencies as well.
I also tried to bind debug to console.info to redirect debug mesages to stdout instead of stderr.

Running yarn workspace <workspace> run <my-dev-scriprt> shows DEBUG messages well.
Running turbo run <my-running-script> --scope=<my-tested-workspace> shows nothing.

Expected Behavior

Would like to use DEBUG with turbo in a normal fashion.
Note that despite I could come out with a replacement to debug using a custom helper function that shows/hides console.log messages related to an ENV setting, there are other dependencies that use DEBUG under the hood and the solution there is outside my scope. Based on the number of dependencies that use DEBUG as a dev logging tool, its proper integration with turbo is desirable.

To Reproduce

Clone and install this repo
git clone https://github.com/denik1981/bugs-turbo-debug-not-working.git
yarn install (or npm)

Run the dev script scoped to the server workscape using turbo CLI
turbo run dev --scope=server // debug messages won't show up

Run the dev script scoped to the server workscape using your package management tool
yarn workspace server run dev // debug messages are shown

The repo is an example code that was generated using the turbo npx creator and a custom server app was added with the express-generator. Nothing fancy. The last and second commit has all the code needed to test DEBUG in the server(express) app. I have commited the .env file as well so you can reproduce the issue well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions