-
Notifications
You must be signed in to change notification settings - Fork 445
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
Cannot read property 'toLowerCase' of null #219
Comments
@lldata can you show me your http file? And do you mean for same http request, after restarting VS Code can succeed? And when you are in error state, can you succeed sending a simple request in another file like Do you have a callstack in this case, and the notificationAlerts.ts is the code from vscode itself |
When I am in the error state ALL requests fail. So I don't think my http file is that important. After restarting all requests resume working as expected. I will attempt to produce a call stack next time I hit the error, but I am not sure how I get it? |
@lldata since retarting can work, maybe it is related to something that keep in memory of the extension lifetime. One thing I can think of is request variable cache. I will continue inspecting this tomorrow. |
Sounds likely. I use request variables extensively. Something related to caching or other mutable state seems very likely. But it might be hard to fix, if you can't reproduce it ;-) |
@lldata I checked all the code used the
Thanks in advance. |
When I first got the error some time ago, I dived into the VSCode debugger and caught the error there. |
@lldata so do you mean the error actually happens in the code from VSCode, not from my extension directly? |
From the debug session my impression was that the toLowerCase call was somewhere in the VSCode code base. But to me it looked like there was a different error below. |
@lldata how did you go into the debug session of vscode? Do all requests reference the same request? BTW, can you try to copy the request as cURL(right click for the selected request) when you meet the situation again and check if any error occurs. |
I managed to reproduce it and get this Call Stack:
|
@lldata Uhh... Thanks for your help. And can you have a clear repro step for me to help me to investigate? Like showing me after sending a request 'A' and then request 'B' will no longer work until you restart vscode. |
I am sorry. I can't reproduce it at will. |
@lldata can you try to repro this issue in latest version 0.19.0, and I add some error log in output channel. Thanks in advance. |
Thank you. I have updated and will investigate next time I can reproduce it. |
@lldata did you meet this problem recently? |
Yeah. One of my colleagues got it while I helped him this week. Only one request in his file didn't work. The others worked fine. |
@lldata next time you meet the issue, please help to check the REST output channel of VSCode, more error details are logged there |
@lldata sorry to bother you again, please help to check if this still happens in latest version like 0.20.2, if yes, please help to inspect the output channel of VSCode with channel name |
We managed to reproduce it. My collegues report that they can reproduce it consistently by copying requests from Skype and into a .rest file. Here is the output from the debug channel:
|
@lldata Thanks so much @lldata. I can reproduce this issue as illustrated in the call stack, which needs to meet all the following three preconditions:
Anyway, I will fix this issue ASAP to handle this case. Really a nice catch 👍 |
@lldata I will publish this fix in next release. |
Amazing feedback time 💯 👍 Thank you for your work! |
@lldata I have published the new version 0.20.3, and you can verify it. And if you still meet this issue, don't hesitate to contact me. |
After running VS Code REST client for a while, I get this error when trying to call any REST service.
"Cannot read property 'toLowerCase' of null".
I can't reproduce it. It just happens every couple of hours or days.
Closing the http file does not resolve it. Only restarting VSCode resolves the issue.
It is quite annoying. I'd like to provide more information, but I don't know where to start.
I get the feeling that the toLowerCase hides another error.
The text was updated successfully, but these errors were encountered: