We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
typescript,info,logger
README.md is clear that the following syntax is legal:
logger.info('Hello world')
However I cannot get this to work with Typescript.
Versions:
Winston version: 3.10.0 Node version: v20.5.1
3.10.0
v20.5.1
Example:
Using "esModuleInterop": true in tsconfig.json to allow the use of Winston using import syntax:
"esModuleInterop": true
tsconfig.json
import
import { Logger, transports, format } from 'winston' const logger = new Logger({ level: 'debug', transports: [new transports.Console()], format: format.combine(format.splat(), format.colorize({ all: true }), format.simple()) }) logger.info('Hello world') export default logger
Expected:
Console output of: Hello world
Actual:
logger_1.default.info is not a function
20.5.1
No response
The text was updated successfully, but these errors were encountered:
Possible duplicate of #2280
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
🔎 Search Terms
typescript,info,logger
The problem
README.md is clear that the following syntax is legal:
logger.info('Hello world')
However I cannot get this to work with Typescript.
Versions:
Winston version:
3.10.0
Node version:
v20.5.1
Example:
Using
"esModuleInterop": true
intsconfig.json
to allow the use of Winston usingimport
syntax:Expected:
Console output of: Hello world
Actual:
logger_1.default.info is not a function
What version of Winston presents the issue?
3.10.0
What version of Node are you using?
20.5.1
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
Using
"esModuleInterop": true
intsconfig.json
to allow the use of Winston usingimport
syntax:Additional information
No response
The text was updated successfully, but these errors were encountered: