[BUG] [error] when scanning selected class
Closed this issue · 10 comments
Describe the bug
A clear and concise description of what the bug is.
When I scan any class in my repo I see an "[error]" appearing.
To Reproduce
Steps to reproduce the behavior:
Scan an apex class
Expected behavior
A clear and concise description of what you expected to happen.
Display the warnings of the Apex classes
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS] Windows 11
- Browser [e.g. chrome, safari] Chrome
- Version [e.g. 22] Chrome Version 119.0.6045.200
Smartphone (please complete the following information):
- OS: [e.g. iOS8.1]
- VSCode Version [e.g. 1.74.0] 1.85.0
- Extension Version [e.g. 0.1.0] v0.3.0
- Scanner Version [e.g. 3.16.0] @salesforce/sfdx-scanner 3.18.0
Additional context
Add any other context about the problem here.
I just try to scan any Apex class and I get this error
"Workaround": Have you found any ways to sidestep the problem? No
"Urgency": How severe is this problem? "Business stopping" vs "Not business-stopping".
Business stopping
@GastonLopezz , I'm unable to reproduce this error with the information you've provided. Can you please fill out the requested information, including what version of the Scanner and Extension you have installed?
@GastonLopezz , I'm unable to reproduce this error with the information you've provided. Can you please fill out the requested information, including what version of the Scanner and Extension you have installed?
Hi @jfeingold35, thanks for your quick response! I filled the requested information with some details of the error, hope this works for you. There is not many more to add because the error appears when I just try to scan an Apex Class no matter which it is.
Thanks in advance!
@GastonLopezz , the "scanner version" field should be the version of SFDX scanner that you have installed. In a CLI terminal, run sf plugins
and let me know what it says for the @salesforce/sfdx-scanner
entry.
@jfeingold35 Sorry for the confusion, it is already updated.
Regards
@GastonLopezz , okay, those are the versions I'm running locally and I'm not seeing that error. Can you please tell me which option you're using to start the scan? ("Scan current file..." or "Scan selected method with Graph Engine"?)
"Scan current file..."
@GastonLopezz , I'm still unable to reproduce. Have you tried the following:
- Updating the scanner to v3.19.0 (we just released that a few days ago).
- Running against an absurdly simple Apex class, perhaps one that has only two methods and they both return
true
?
@jfeingold35 I get this when I tried to update it
I also tried creating a Test class with a simple method that returns a boolean and the same issue happened
@GastonLopezz , I've never seen that error before, and our project doesn't seem to have a dependency on @salesforce/lwc-dev-server
. So I'm not sure where that error could be coming from. But it does seem like it might be related to the mysterious error you're seeing in VSCode.
Could you please try one more thing for me? What happens if you run the scanner plugin directly through the CLI (via sf scanner run
) instead of through the VSCode command? Does that return results, or does it also error out?
Hi @jfeingold35 I could make salesforce scanner work after uninstalling all the plugins that were causing warnings (including lwc-dev-server, looks like this one was blocking the scanner).
Thanks for your help!