Skip to content
New issue

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

Error: Making a request with empty options is not supported in Nock with [email protected] #4896

Open
benconnito opened this issue Nov 15, 2024 · 6 comments

Comments

@benconnito
Copy link

benconnito commented Nov 15, 2024

after upgrading to [email protected] 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"
  }
}
@benconnito
Copy link
Author

looks like 2e12247e20c0ea303b709b4028d11bb10d5a5ba9 broke it

@benconnito
Copy link
Author

#4836

the

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

block somehow breaks this

@benconnito
Copy link
Author

benconnito commented Nov 26, 2024

@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...

@benconnito
Copy link
Author

using DD_TRACE_DISABLED_INSTRUMENTATIONS=url as a workaround

@simon-id
Copy link
Member

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

@uurien
Copy link
Collaborator

uurien commented Nov 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants