question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error during building process of server app via winston 3.2

See original GitHub issue

Please tell us about your environment:

  • _winston version 3.2
    • winston@2
    • winston@3
  • _node -v outputs: 11.8.0 or 9.11.1
  • Operating System? (macOS)
  • Language? (TypeScript 3.2.4)

What is the problem?

I have server and client app written in Typescript. I build all apps to js with webpack 4.29.0. Then I switched to winston 3.2 from winston 3.1 I saw sad error in webpack output:

webpack:///./node_modules/winston-transport/index.js?:4
const Writable = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'readable-stream/writable'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));
                                                                                                                                                                          ^

Error: Cannot find module 'readable-stream/writable'
    at webpackMissingModule (webpack:///./node_modules/winston-transport/index.js?:4:82)
    at eval (webpack:///./node_modules/winston-transport/index.js?:4:181)
    at Object../node_modules/winston-transport/index.js (/Users/a.malko/Work/raw/build/server.js:4362:1)
    at __webpack_require__ (/Users/a.malko/Work/raw/build/server.js:20:30)
    at eval (webpack:///./node_modules/winston-transport/legacy.js?:5:25)
    at Object../node_modules/winston-transport/legacy.js (/Users/a.malko/Work/raw/build/server.js:4374:1)
    at __webpack_require__ (/Users/a.malko/Work/raw/build/server.js:20:30)
    at eval (webpack:///./node_modules/winston/lib/winston/logger.js?:16:31)
    at Object../node_modules/winston/lib/winston/logger.js (/Users/a.malko/Work/raw/build/server.js:4470:1)
    at __webpack_require__ (/Users/a.malko/Work/raw/build/server.js:20:30)

What do you expect to happen instead?

I want winston to be ok 😃

Other information

tsconfig:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "tslib": [
        "./node_modules/tslib/tslib.d.ts"
      ],
      "*": [
        "src/*"
      ]
    },
    "inlineSourceMap": true,
    "inlineSources": true,
    "module": "commonjs",
    "alwaysStrict": true,
    "target": "es5",
    "pretty": false,
    "jsx": "react",
    "strict": true,
    "strictNullChecks": true,
    "noEmitHelpers": true,
    "importHelpers": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "strictPropertyInitialization": false,
    "lib": [
      "es2016",
      "es2017",
      "dom"
    ]
  },
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:12
  • Comments:8

github_iconTop GitHub Comments

1reaction
cuplizcommented, May 17, 2021

i re-install npm i winston after npm i and everything works again

0reactions
zhex900commented, Jul 4, 2021

I have the same problem with yarn on macOS. I am using yarn workspaces Winston 3.1 doesn’t work for me. webpack issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

winston 3.2.1 version is not creating log file - Stack Overflow
In your app.js code, the Winston import is for the npm package and not for the logger object ... Start the server const...
Read more >
express-winston - npm
express-winston provides middlewares for request and error logging of your express.js application. It uses 'whitelists' to select properties from the request ...
Read more >
How to use the winston.error function in winston - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >
Developer Story: Always Bring Receipts - JavaScript in Plain English
My personal strategy for logging activity in NodeJS applications. ... the main critical activity and error logging logic in my application using winston:...
Read more >
Slack refusing to start - Ask Ubuntu
After downgrade, running slack from command line no longer outputs [winston] Attempt to write logs with no transports errors after Initializing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found