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

Debug shows different timestamp formats across package and project #867

Closed
imjamesb opened this issue Feb 4, 2022 · 18 comments
Closed

Debug shows different timestamp formats across package and project #867

imjamesb opened this issue Feb 4, 2022 · 18 comments
Labels
question This issue asks a question or requests usage support

Comments

@imjamesb
Copy link

imjamesb commented Feb 4, 2022

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

image

image

image

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

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

image

@Qix-
Copy link
Member

Qix- commented Feb 4, 2022

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.

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

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

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

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..

@Qix-
Copy link
Member

Qix- commented Feb 4, 2022

What does npm ls debug show?

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

image

@Qix-
Copy link
Member

Qix- commented Feb 4, 2022

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

{
    "overrides": {
        "[email protected]": {
            "debug": "4.3.3"
        }
    }
}

Does that work?

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

image

image

image

@Qix-
Copy link
Member

Qix- commented Feb 4, 2022

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.

@Qix-
Copy link
Member

Qix- commented Feb 4, 2022

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.

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

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

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

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

@Qix-
Copy link
Member

Qix- commented Feb 4, 2022

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.

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

image

Got them back

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

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

The override still doesn't work

@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

  "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

@Qix-
Copy link
Member

Qix- commented Feb 4, 2022

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.

@Qix- Qix- closed this as completed Feb 4, 2022
@Qix- Qix- added the question This issue asks a question or requests usage support label Feb 4, 2022
@imjamesb
Copy link
Author

imjamesb commented Feb 4, 2022

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
Labels
question This issue asks a question or requests usage support
Development

No branches or pull requests

2 participants