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

Bug: Cannot read property 'isError' of null #85

Closed
flybayer opened this issue Jan 27, 2021 · 2 comments
Closed

Bug: Cannot read property 'isError' of null #85

flybayer opened this issue Jan 27, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@flybayer
Copy link

Describe the bug

tslog version: 3.1.0

Unfortunately I don't know how to reproduce this but I periodically get an error thrown by tslog of Cannot read property 'isError' of null while attempting to log a message with a JS object. I see this usually in production. Although I think I've also seen it in local dev.

Expected behavior

Should not error

Additional context

import { Logger } from "tslog"

export const logger = new Logger({
  type: clientEnv.isProduction ? "json" : "pretty",
  dateTimePattern: "hour:minute:second.millisecond",
  displayFunctionName: false,
  displayFilePath: "hidden",
  dateTimeTimezone: clientEnv.isProduction
    ? "utc"
    : Intl.DateTimeFormat().resolvedOptions().timeZone,
  prettyInspectHighlightStyles: { name: "yellow", number: "blue", bigint: "blue", boolean: "blue" },
  maskValuesOfKeys: ["password", "passwordConfirmation"],
  exposeErrorCodeFrame: !clientEnv.isProduction,
})


// And then I'm also using a child logger
const log = logger.getChildLogger({ prefix: ["submitGroupStep1()"] })

Node.js Version
12

@flybayer flybayer added the bug Something isn't working label Jan 27, 2021
@terehov terehov closed this as completed in 98b3311 Feb 3, 2021
@terehov
Copy link
Contributor

terehov commented Feb 3, 2021

I tried multiple things and wasn't really able to reproduce this issue and also couldn't find that error in my logs.
However, I've found one spot with a missing optional chaining, which I added. So I really hope 🤞 that it solves this issue.

@terehov
Copy link
Contributor

terehov commented Feb 3, 2021

Would be awesome, if you could let me know if this problem still present with this version. Thank you.

https://github.com/fullstack-build/tslog/releases/tag/v3.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants