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: interface is missing optional hostname #268

Open
Infern1 opened this issue Oct 4, 2023 · 2 comments
Open

Bug: interface is missing optional hostname #268

Infern1 opened this issue Oct 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Infern1
Copy link

Infern1 commented Oct 4, 2023

Describe the bug
Compiler complains Property 'hostname' does not exist on type 'IMeta'. However it does exist, maybe not in all cases.

To Reproduce
Try to access the logObj

Expected behavior
Interface is extended with all parameters, something like:

export interface IMeta extends IMetaStatic {
  date: Date;
  logLevelId: number;
  logLevelName: string;
  hostname?: string;
  path?: IStackFrame;
}
@Infern1 Infern1 added the bug Something isn't working label Oct 4, 2023
@terehov
Copy link
Contributor

terehov commented Oct 5, 2023

How can I reproduce this?

@Infern1
Copy link
Author

Infern1 commented Oct 5, 2023

See this stackblitz:

https://stackblitz.com/edit/nodets-csuh1z?file=src%2Fmain.ts

src/main.ts:14:41 - error TS2339: Property 'hostname' does not exist on type 'IMeta'.

14   console.log(`hostname: ${output._meta.hostname}`)
                                           ~~~~~~~~


Found 1 error in src/main.ts:14

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
Development

No branches or pull requests

2 participants