fastify: the interface of the fastify shim seems incorrect
See original GitHub issueThe interface of the fastify shim seems incorrect.
Without the new relic shim:
const fastify_1 = require('fastify');
console.log('index 2 >', fastify_1);
console.log('index 3 >', fastify_1.fastify);
Output:
index 2 > <ref *1> [Function: fastify] {
fastify: [Circular *1],
default: [Circular *1]
}
index 3 > <ref *1> [Function: fastify] {
fastify: [Circular *1],
default: [Circular *1]
}
With the newrelic fastify shim NEW_RELIC_FEATURE_FLAG_FASTIFY_INSTRUMENTATION=1
require('newrelic');
const fastify_1 = require('fastify');
console.log('index 3 >', fastify_1);
console.log('index 4 >', fastify_1.fastify);
Output:
index 3 > [Function: wrappedFastifyModule] { __NR_instrumented: true }
index 4 > undefined
This then leads to breaking anything else that may be expecting the .fastify
on the module returned from require.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Errors - Fastify
¶Error Handling In Node.js. ¶Uncaught Errors. In Node.js, uncaught errors are likely to cause memory leaks, file descriptor leaks, and other major production ......
Read more >lib/shim/webframework-shim.js - Documentation
* A helper class for wrapping web framework modules. * @param {Agent} agent; * The agent this shim will use.
Read more >NestJS: It's making me cry : r/node - Reddit
I can't define an interface for the body of a POST controller and use ... It exposes Express/Fastify underneath if you need to...
Read more >How to enable CORS in a Fastify application - Morioh
fastify -cors: Configures the Access-Control-Allow-Origin CORS header in ... to true to reflect the request origin, or set it to false to disable...
Read more >Security Bulletin 12 Oct 2022
CVE Number Base Score Reference
CVE‑2021‑3570 8.8 https://nvd.nist.gov/vuln/detail/CVE‑2021‑3570
CVE‑2021‑39139 8.8 https://nvd.nist.gov/vuln/detail/CVE‑2021‑39139
CVE‑2021‑32626 8.8 https://nvd.nist.gov/vuln/detail/CVE‑2021‑32626
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
@michaelgoin thanks! yeah, i kept reloading the npm info page to see when it was published. Its installed, working ok so far. Just have the ui bug (#757), but can live with that since its just cosmetic. I appreciate the quick turnaround.
thanks 👍🏼
@michaelgoin For me, would be nice to have the quick fix in NR for now, so I can move forward with our instrumentation. would be prefered, since a manual workaround would be tricky. (i was able to do it just to verify the issue)