Skip to content

Debug shows different timestamp formats across package and project #867

Closed

Description

@imjamesb

Debug shows different timestamp formats for body-parser, express and my project.

image

image

image

Activity

  1. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    I also attempted to use the override feature, did not work though.

    image

  2. Qix- commented on Feb 4, 2022

    @Qix-
    Member

    Mrh yeah sorry about that. I'm still trying to figure out the best way to fix this problem. Unfortunately it's not straightforward or obvious to solve. #556 was (is) supposed to address this issue, but with the advent of module loaders and losing access to the import cache, things have gotten more complicated.

  3. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    Ah I see, so if I understand correctly, this is Express' doing?

  4. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    image

    For some reason, when degrading to 2.6.9 (the same version express depends on) my logs use the GMT format, and express' logs uses the ISO format.

    Weird..

  5. Qix- commented on Feb 4, 2022

    @Qix-
    Member

    What does npm ls debug show?

  6. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    image

  7. Qix- commented on Feb 4, 2022

    @Qix-
    Member

    Not sure that ^ is allowed in overrides. Maybe start with just

    {
        "overrides": {
            "debug@2.6.9": {
                "debug": "4.3.3"
            }
        }
    }

    Does that work?

  8. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    image

    image

    image

  9. Qix- commented on Feb 4, 2022

    @Qix-
    Member

    No idea then :/ Which order are you importing debug? Do you first import it before or after express? If after, try importing it before anything else.

  10. Qix- commented on Feb 4, 2022

    @Qix-
    Member

    Actually looking at your npm ls output it doesn't appear the override is working. Are you using package-lock.json files per chance?

    Try deleting it (I have them turned off by default, typically - they add no value) then re-installing.

  11. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    Yes, I'll delete the lockfile and try again ;)

  12. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    Okay, so for some reason my own debugs no longer work - but express' do

  13. Qix- commented on Feb 4, 2022

    @Qix-
    Member

    By "not work" do you mean just no output? Or is there an error?

    Try blowing away both node_modules and any lockfiles and re-installing from scratch, then.

  14. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    image

    Got them back

    It didn't output, even though DEBUG was set to *, it was because dotenv was loaded after debug I think

  15. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    The override still doesn't work

  16. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author
      "overrides": {
        "express": {
          "debug": "4.3.3"
        },
        "nodemon": {
          "debug": "4.3.3"
        },
        "apollo-server-express": {
          "body-parser": {
            "debug": "4.3.3"
          }
        }
      }

    Turns out this was the way to go, it works using this. Probably time to do a couple of version bump PRs

  17. Qix- commented on Feb 4, 2022

    @Qix-
    Member

    Oh right, that makes sense 🙃 sorry I didn't catch it the first time haha.

    Yeah seems right! Feel free to ping me on any you may open.

    Going to go ahead and close this now. Let me know if there's anything else.

  18. added
    questionThis issue asks a question or requests usage support
    on Feb 4, 2022
  19. imjamesb commented on Feb 4, 2022

    @imjamesb
    Author

    Awesome, thanks for your help, awesome library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionThis issue asks a question or requests usage support

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions