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.

Deprecation warnining in Node 7

See original GitHub issue

Expected behavior

Things to work! (i.e. no deprecation warnings crashing Karma)

Actual behavior

This deprecation warning:

node.exe : (node:2636) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.

Environment Details

  • Karma version (output of karma --version): 1.3.0
  • Relevant part of your karma.config.js file: N/A (I think - here’s my config)
  • OS: Windows only

Steps to reproduce the behavior

  1. Run Karma in Node 7
  2. Watch the output

This came up in CI, and has been failing my Windows builds (oddly, it’s not affecting my Linux builds). Downgrading Node did fix the problem, though.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tmaircommented, Nov 29, 2016

Just as a reference the deprecation warning was introduced with https://github.com/nodejs/node/pull/8169/commits/996389c0b9bf87e3b393d06e18e722635035d579 and reverted with https://github.com/nodejs/node/commit/4fffe32a4b3a93548c4d39b1c2531aa38403b5e6. So in the next 7.x node version it should not cause any troubles anymore, but it might be a breaking change in nodejs 8

0reactions
dead-claudiacommented, Dec 7, 2016

Here’s the involved files:

  • karma.conf.js:
module.exports = function(config) {
  config.set({
    frameworks: ['mocha'],
    files: ['test.js'],
    browsers: ['Chrome'],
    singleRun: true,
  })
}
  • package.json:
{
  "scripts": {"test": "karma start"},
  "devDependencies": {
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-mocha": "^1.3.0",
    "mocha": "^3.2.0"
  }
}
  • test.js:
describe("foo", function () {
    it("works", function () {})
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js deprecation warning and better developer experiences
Let's talk about v7 and the better developer experience it brings, discuss the Node.js deprecation warning and more.
Read more >
[NodeJs16] DeprecationWarning: Invalid 'main' field #7 - GitHub
Hi, Since Nodejs 16 I am getting following DeprecationWarning: Invalid 'main' field in '\node_modules\objectorarray\package.json' of 'dist/index ...
Read more >
Deprecated APIs | Node.js v19.3.0 Documentation
Node.js APIs might be deprecated for any of the following reasons: ... This means there will not be deprecation warnings for Buffer() usage...
Read more >
(node: 15702) How to remove DeprecationWarning on Node.js?
I am getting a deprecation warning message on my shell while using Node.js. It started showing up in the middle of my project, ......
Read more >
What is Node.js util.deprecate() ? - Educative.io
When util.deprecate() is called, it emits a DeprecationWarning using the 'warning' event. If the same code is provided for multiple calls ...
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