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.

something in logger causing error about self._addDefaultMeta

See original GitHub issue

I am using a node plugin https://github.com/mhartington/nvim-typescript which requires the node host. when I use one of the functions there I get the following error in the node log…

{"message":"Error in plugin for command:TSGetDiagnostics: self._addDefaultMeta is not a function (file: /Users/Jeff/.config/nvim/plugged/nvim-typescript/rplugin/node/nvim_typescript, stack: TypeError: self._addDefaultMeta is not a function\n    at Object.DerivedLogger.<computed> [as warn] (/Users/Jeff/.config/yarn/global/node_modules/winston/lib/winston/create-logger.js:80:14)\n    at Object.getDiagnostics (/Users/Jeff/.config/nvim/plugged/nvim-typescript/rplugin/node/nvim_typescript/lib/index.js:1:24189)\n    at Object.fn (/Users/Jeff/.config/yarn/global/node_modules/neovim/lib/host/NvimPlugin.js:19:26)\n    at NvimPlugin.<anonymous> (/Users/Jeff/.config/yarn/global/node_modules/neovim/lib/host/NvimPlugin.js:155:41)\n    at Generator.next (<anonymous>)\n    at /Users/Jeff/.config/yarn/global/node_modules/neovim/lib/host/NvimPlugin.js:8:71\n    at new Promise (<anonymous>)\n    at __awaiter (/Users/Jeff/.config/yarn/global/node_modules/neovim/lib/host/NvimPlugin.js:4:12)\n    at NvimPlugin.handleRequest (/Users/Jeff/.config/yarn/global/node_modules/neovim/lib/host/NvimPlugin.js:133:16)\n    at Host.<anonymous> (/Users/Jeff/.config/yarn/global/node_modules/neovim/lib/host/index.js:71:27))","level":"error"}

It seems someone else has seen the error as well in #154. It looks like #139 is probably the same issue too. I looked into the library where this is coming from and there also seems to be some issues there https://github.com/winstonjs/winston/issues/1591 and https://github.com/winstonjs/winston/issues/1577. I looked through the files a little bit here but I cannot see the exact reason why this is happening in neovim’s node client.

I haven’t been using node for a while and I just updated everything to dust off an old project when I ran into this error. Does anyone see why this would be happening?

If I use the chrome debugger I run into the following console error, I am unsure if it is related or not…

internal/process/warning.js:33 (node:17278) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
billyvgcommented, Aug 21, 2020

Yeah I think winston was chosen so that we could use different transports

0reactions
pyrhocommented, Aug 21, 2020

Alright, will submit a PR with the winston locked version and the yarn.lock file.

edit: Oh it seems the repo is using lerna, so I guess the top-level yarn.lock file is being used.

Read more comments on GitHub >

github_iconTop Results From Across the Web

self._addDefaultMeta is not a function error still occurs with 3.2.1
I am trying to configure sails.log in config/log.js using the above code. But it's not logging out anything. Can someone please guide on...
Read more >
Error after update winston to version 3.2.1. TypeError: self ...
It seems webpack-hot-middleware doesn't work correctly with the latest version of winston. I would be grateful for advice on how to fix this....
Read more >
winstonjs/winston - Gitter
hello, does anyone import daily-rotate-logger-file package and see this error Uncaught TypeError: Cannot set property 'DailyRotateFile' of undefined ?
Read more >
Java Application Developer's Guide - Documentation
12.5 Logging To The Server's Error Log . ... The following topics cover key things you should know ... Passing null to addDefaultMetadata()...
Read more >
winston - npm
A multi-transport async logging library for Node.js. ... For example, one may want error logs to be stored in a persistent remote location ......
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