DataDog/dd-trace-js

Error: Making a request with empty `options` is not supported in Nock with dd-trace@5.25.0

Opened this issue · 6 comments

after upgrading to dd-trace@5.25.0 i am getting:

"Error: Making a request with empty options is not supported in Nock"

import 'dd-trace'
import nock from 'nock'
import got from 'got'

nock('https://fake.fake/').get('/').reply(200, {valid: true})
console.log(await got.get('https://fake.fake/').json())

works with this package.json

{
  "type": "module",
  "dependencies": {
    "dd-trace": "5.24.0",
    "got": "^14.4.4",
    "nock": "^13.5.6"
  }
}

but not

{
  "type": "module",
  "dependencies": {
    "dd-trace": "5.25.0",
    "got": "^14.4.4",
    "nock": "^13.5.6"
  }
}

looks like 2e12247e20c0ea303b709b4028d11bb10d5a5ba9 broke it

#4836

the

shimmer.wrap(url, 'URL', (URL) => {
    return class extends URL {

block somehow breaks this

@rochdev @uurien i dont know enough about what shimmer.wrap is trying to do here... but this is at least breaking anyone using nock to mock got .. which seems like it would not be a small amount...

using DD_TRACE_DISABLED_INSTRUMENTATIONS=url as a workaround

Thank you for reporting the bug! We're looking into it now 👍

Thank you for reporting this! The issue has been addressed in this PR: #4955 and it is already merged.

It should be fixed in the next release.

Thanks.