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
Failed to instrument module @redis/client #2012
Comments
👋 thank you for the report. Please provide a minimal reproducible example. Doing so will help us diagnose the issue. It should be the bare minimum code needed to trigger the issue, and easily runnable without any changes or extra code. You may use a GitHub repository to host the code if it is too much to fit into a code block (or two). |
@jsumners-nr using the packages specified above: // app.js
import { createClient } from 'redis'; node --experimental-loader newrelic/esm-loader.mjs -r newrelic app.js |
@MartinKolarik thanks! I can reproduce your issue on windows. We will investigate a fix and get back to you, sorry for your troubles. |
Triage notes: It looks like our logic to determine the On unix: {"v":0,"level":20,"name":"newrelic","hostname":"TK46XHNX04","pid":96221,"time":"2024-02-12T17:14:55.183Z","msg":"BOB DEBUG /Users/revans/code/redis-app/node_modules/@redis/client, dist/lib/client/commands.js","component":"Shim"} On windows: {"v":0,"level":20,"name":"newrelic","hostname":"node-test-vm","pid":7192,"time":"2024-02-12T17:12:50.899Z","msg":"BOB-DEBUG C:\\Users\\node_admin\\test\\node_modules\\@redis dist/lib/client/commands.js","component":"Shim"} |
@MartinKolarik this was released yesterday in 11.10.4, can you verify this fixes your issue? |
@bizob2828 yes, fixed, thanks! |
Description
When starting the app, I get the following warning:
Expected Behavior
The module is instrumented without errors.
Troubleshooting or NR Diag results
After a quick look at the relevant code, I see there's an attempt to load
dist/lib/client/commands.js
from@redis/client,
but the shim object that does the loading has_moduleRoot
set tonode_modules/@redis
(without/client
) for some reason, so this fails:I tried changing the require call from
shim.require('dist/lib/client/commands.js')
toshim.require('client/dist/lib/client/commands.js')
and that fixes the issue - but not sure, it seems the real issue is the wrong shimmer root.
Steps to Reproduce
Your Environment
Additional context
The text was updated successfully, but these errors were encountered: