-
Notifications
You must be signed in to change notification settings - Fork 769
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
PyLance crashes when setting node option '--no-deprecation' #5911
Comments
Thanks for the issue. The super long line would help. Or at least the start of the line. It should show what line is crashing. We can then use our internal source maps to figure out where that is in our code. |
Sure thing: |
Unfortunately the log doesn't have any meaningful info. can you make sure the log contains things described here? https://github.com/microsoft/pylance-release/wiki/Collecting-data-for-an-investigation.#collecting-trace-logs for your case, since it crash almost right away, set the setting in |
I have It might also be worth noting that most PyLance commands (e.g., Pylance: Start Logging) gives me "command 'pylance.logging.start' not found". |
Hmm, maybe VS code is truncating the output for some reason. It should have something like this in it somewhere:
(I forced that on my machine by editing some bytes in the server.bundle.js). Prior to that line it dumps the entire server.bundle.js for some reason. Can you try setting this value higher?
|
Hmm I see, I can't seems to get rid of the truncation. I set |
have you tried to delete |
Yep, I've tried that several times. I also tried some more aggressive purging (reinstall VSCode locally, clearing all configuration files locally + remotely, clearing ~/.cache). |
I just confirmed that it works on a different remote machine, so it's definitely a problem with that machine. However, I'm not sure what else to try, since I'm not familiar with what else could possibly affect PyLance. Let me more comprehensively enumerate what I tried:
All of these have led to the exact same outcome as far as I can tell. Any other suggestions? |
What if you change server.bundle.js to just server.bundle.js would be in the Does that show a callstack? |
I can only guess that some global node option on that machine is messing something up. Although if that were the case, I wouldn't expect any extensions to load either. |
I uninstalled everything node-related that I could find from my machine. I was using NVM so I just deleted ~/.nvm. Crash is still happening. If I add
|
Does an older version work on this machine? Like 2024.4.1? |
We changed our obfuscation in 2024.5.1. I wonder if that's breaking something somehow. |
No, I tried a bunch of different versions (all the way back to 2023.12.1) and more or less the same thing happens. I just double-checked with 2024.4.1. |
Do any of the older versions give you a callstack for the crash? |
Another thing to try is go on the machine and just run
But if something is messed up in the bundle or in your node, maybe running it from the command line will give us a callstack. |
Ah nice, that gave me the traceback! Here it is:
|
(same error in 2023.12.1, this is using vscode-server bundled node) |
Not sure why we have this in our code but this is the failing line:
It must mean you have an environment variable NODE_ENV set to production. Would explain why this is failing on just the one machine. |
This is very strange, since I definitely don't have the NODE_ENV variable set. In fact:
|
Oh my god, I figured it out. It's because I had set the environment variable Seems like globally setting |
Glad you figured out. Thanks for the help. |
Thanks for the real-time support! |
Environment data
Code Snippet
N/A
Repro Steps
Purged all VSCode cache and config files from both my local machine and the remote server I'm connected to via SSH. Created a single
.py
file, opened it, and installed the Python extension pack. Immediately get a crash from PyLance:I tried:
How do I debug this further? I have absolutely no way to edit any Python files on this machine now.
The text was updated successfully, but these errors were encountered: