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]: #246

Closed
pravin-deore opened this issue Feb 8, 2023 · 3 comments
Closed

[Bug]: #246

pravin-deore opened this issue Feb 8, 2023 · 3 comments

Comments

@pravin-deore
Copy link

The problem

With latest changes in 2.5.* , following change is added in index.d.ts, which is causing issue "TS1023: An index signature parameter type must be either 'string' or 'number'"

Typescript : 4.3.5
Node : 14

export interface TransformableInfo {
level: string;
message: any;
[LEVEL]?: string;
[MESSAGE]?: any;
[SPLAT]?: any;
[key: string | symbol]: any;
}

What version of Logform presents the issue?

v2.5.0 and v2.5.1

What version of Node are you using?

v14.17.3

If this worked in a previous version of Logform, which was it?

v2.4.2

Minimum Working Example

import {
  createLogger,
  format,
  transports,
  Logger as WinstonLogger,
} from 'winston';

const logger = createLogger({
  level: "error",
  format: format.combine(format.timestamp(), format.json()),
  transports: [new transports.Console({ handleExceptions: false })],
  exitOnError: false,
});

logger.log('debug', "127.0.0.1 - there's no place like home");

package.json

{
"name": "logform-issue",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"build": "tsc -p tsconfig.json"
},
"author": "",
"license": "ISC",
"dependencies": {
"@types/node": "^18.13.0",
"winston": "^3.8.2",
"typescript": "4.3.5"
}
}

Additional information

No response

🔎 Search Terms

typescript

@DABH
Copy link
Contributor

DABH commented Feb 8, 2023

Are you able to try with TS 4.4+? As reported in some other issues recently, logform 2.5+ (unintentionally) now depends on TS 4.4+, so if your project is stuck with TS 4.3, we recommend pinning logform as a dependency to 2.4.2.

@pravin-deore
Copy link
Author

Yes, after changing typescript version to 4.4+ there is no issue.

@DABH DABH closed this as completed Feb 9, 2023
@wbt
Copy link
Contributor

wbt commented Feb 9, 2023

Duplicate of #244 if folks coming later have further discussions, though only evident if you read this far in that chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants