TypeError: Cannot read property 'agent' of undefined
See original GitHub issueDescription
after update to node 16 I got this error
TypeError: Cannot read property 'agent' of undefined
at instrumentDatastore (/Users/minafawzy/Documents/TechModgroup/BDS-API/node_modules/newrelic/api.js:1221:23)
at Object.<anonymous> (/Users/minafawzy/Documents/TechModgroup/BDS-API/index.ts:3:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Module._compile (/Users/minafawzy/Documents/TechModgroup/BDS-API/node_modules/source-map-support/source-map-support.js:568:25)
at Module.m._compile (/private/var/folders/qy/g_lynwh536s_39w1_47zgwz40000gn/T/ts-node-dev-hook-5979901015148208.js:69:33)
at Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at require.extensions.<computed> (/private/var/folders/qy/g_lynwh536s_39w1_47zgwz40000gn/T/ts-node-dev-hook-5979901015148208.js:71:20)
at Object.nodeDevHook [as .ts] (/Users/minafawzy/Documents/TechModgroup/BDS-API/node_modules/ts-node-dev/lib/hook.js:63:13)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
Expected Behavior
to be working NOTE: # ( Tell us what you expected to happen. )
Troubleshooting or NR Diag results
Steps to Reproduce
work in node 16 NOTE: # ( Please be as specific as possible. ) TIP: # ( Link a sample application that demonstrates the issue. )
Your Environment
- ex: Browser name and version:
- ex: Node version:
- ex: Operating System and version:
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Error after setup node.js agent: Cannot read property ' ...
newrelic agent: v1.29.0 Question: I setup the node.js agent in my ... TypeError: Cannot read property '__NR_original' of undefined at ...
Read more >nodejs/node - Gitter
agent = new https.Agent(options); ^ TypeError: Cannot read property 'Agent' of undefined at Object.<anonymous> (/data/opt/app.js:17:26) at Module._compile ( ...
Read more >Cannot read properties of undefined (reading 'name'); - ...
TypeError: Cannot read properties of undefined (reading 'name'); ; Sounds like name isnt on body.data. Try printing just body.data, to determine ...
Read more >Resolving TypeError: Cannot Read Property of Undefined ...
The TypeError: Cannot read property of undefined is one of the most common type errors in JavaScript. It occurs when a property is...
Read more >TypeError: Cannot read property "predictedValue" f...
TypeError : Cannot read property "predictedValue" from undefined. Joshua Garrison. Kilo Contributor. Options.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is caused by the way Typescript handles
*
imports (you can check generated JS code). It will work if you change:to
seems that was the issue thanks I am closing the issue