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: Expected an Agent instance as the first argument #84

Open
diavrank opened this issue Nov 9, 2024 · 0 comments
Open

error: Expected an Agent instance as the first argument #84

diavrank opened this issue Nov 9, 2024 · 0 comments

Comments

@diavrank
Copy link

diavrank commented Nov 9, 2024

Hi, I am migrating my Nestjs app to use Bun js and I am getting this error:

[8:41:04 PM] Starting compilation in watch mode...

[8:41:30 PM] Found 0 errors. Watching for file changes.

17 | 
18 | const supportsALL = typeof ALL === 'number';
19 | 
20 | const verifyAgent = agent => {
21 |    if (!(agent && typeof agent.createConnection === 'function')) {
22 |            throw new Error('Expected an Agent instance as the first argument');
             ^
error: Expected an Agent instance as the first argument
      at verifyAgent (/Users/diavrank/app/node_modules/cacheable-lookup/source/index.js:22:9)
      at install (/Users/diavrank/app/node_modules/cacheable-lookup/source/index.js:394:3)
      at new Request (/Users/diavrank/app/node_modules/amply.js/lib/request.js:65:19)
      at new Client (/Users/diavrank/app/node_modules/amply.js/lib/client.js:9:20)
      at /Users/diavrank/app/node_modules/amply.js/index.js:4:18
      at /Users/diavrank/app/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/dist/commons/services/email.service.js:17:20
      at /Users/diavrank/app/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/dist/app/events/events.service.js:105:7
      at /Users/diavrank/app/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/dist/commons/services/eraseme.service.js:7:7
      at /Users/diavrank/app/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/dist/app/create-event/create-event.service.js:15:7
      at /Users/diavrank/app/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/dist/app/companies/connections/services/connections.service.js:53:7
      at /Users/diavrank/app/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/dist/app/companies/services/admin-onboarding.service.js:22:7
      at /Users/diavrank/app/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39
      at /Users/diavrank/app/node_modules/require-in-the-middle/index.js:188:39

Bun v1.1.34 (macOS arm64)

Command to run Nest app:

bun start

start script in package.json

"start": "bun NODE_ENV=localdev nest start --watch --exec \"bun run\"",

I am using amply.js library that uses this package on its version 6.0.4

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

1 participant