https://pulumi.com logo
Title
q

quaint-match-50796

04/28/2023, 2:05 PM
Is anyone else facing VS Code TS server crashes when using @pulumi/azure-native after last updates ?
s

salmon-account-74572

04/28/2023, 2:24 PM
What does your
import
statement look like?
q

quaint-match-50796

04/28/2023, 2:25 PM
import * as azure_native from "@pulumi/azure-native"
Webstorm loads it correctly. Only VS Code TS server crashes.
s

salmon-account-74572

04/28/2023, 2:29 PM
We’ve seen issues with the VS Code TS server when you import all of
@pulumi/azure-native
in this fashion. (The Azure Native API is quite…beefy.) The workaround is to import only those portions you need.
q

quaint-match-50796

04/28/2023, 2:36 PM
Yes, around 450MB. But it's not a constant behavior. I'll open an issue for improvement on VS Code. Pycharm index everything nicely.
s

salmon-account-74572

04/28/2023, 2:39 PM
Sounds good, thanks!
q

quaint-match-50796

04/28/2023, 3:14 PM
It's still crashing:
Info 52   [15:11:01.493] FileWatcher:: Added:: WatchInfo: /root/intelijus/repos/xxxxxxx/src/nodejs/xxxxx/package.json 250 undefined WatchType: package.json file
Info 53   [15:11:01.496] AutoImportProviderProject: found 1 root files in 1 dependencies in 3.620777130126953 ms
Info 54   [15:11:01.497] Starting updateGraphWorker: Project: /dev/null/autoImportProviderProject1*
Info 55   [15:11:01.500] DirectoryWatcher:: Added:: WatchInfo: /root/intelijus/repos/xxxx/src/nodejs/xxxx/node_modules 1 undefined Project: /dev/null/autoImportProviderProject1* WatchType: Failed Lookup Locations
Info 56   [15:11:01.500] Elapsed:: 0.012430191040039062ms DirectoryWatcher:: Added:: WatchInfo: /root/intelijus/repos/xxxxx/src/nodejs/xxxx/node_modules 1 undefined Project: /dev/null/autoImportProviderProject1* WatchType: Failed Lookup Locations
Info 57   [15:11:01.500] FileWatcher:: Added:: WatchInfo: /root/intelijus/repos/xxxxx/src/nodejs/xxxx/node_modules/@pulumi/azure-native/package.json 2000 undefined Project: /dev/null/autoImportProviderProject1* WatchType: File location affecting resolution
Info 58   [15:11:01.526] FileWatcher:: Added:: WatchInfo: /root/intelijus/repos/xxxxx/src/nodejs/xxxxx/node_modules/@pulumi/pulumi/package.json 2000 undefined Project: /dev/null/autoImportProviderProject1* WatchType: File location affecting resolution
Info 59   [15:11:01.533] FileWatcher:: Added:: WatchInfo: /root/intelijus/repos/xxxxx/src/nodejs/xxxxx/node_modules/@pulumi/query/package.json 2000 undefined Project: /dev/null/autoImportProviderProject1* WatchType: File location affecting resolution
w

worried-rain-74420

04/28/2023, 6:09 PM
Some issues we're aware of that will help: https://github.com/pulumi/pulumi/issues/8613 and the related epic https://github.com/pulumi/pulumi/issues/11558 . One issue we've had with Azure Native is that all types are imported at once. Given the size of the package, this can be painful for IDE users.
The workaround is to import only those portions you need.
That might help with IDE usage. Largely this problem in particular was ameliorated last year when we added module lazy-loading. Type definitions still aren't lazy-loaded, which is a problem.. 😕
q

quaint-match-50796

04/28/2023, 6:12 PM
Thank you, Robbie. We tried to load only resources and cognitive-services. Issues still happens.
w

worried-rain-74420

04/28/2023, 6:13 PM
Yeah, sorry about the inconvenience. Feel free to open an issue; I can't make heads or tails of the error message you provided in this thread. It doesn't sound related to the performance issue, but I dunno! 🤷‍♂️
q

quaint-match-50796

04/28/2023, 6:14 PM
We just bought some Webstorm licenses to avoid the issue for our devs.
w

worried-rain-74420

04/28/2023, 6:15 PM
Yeah, gotcha. If you encounter a memory-consumption issue in Jetbrains, I believe you can increase the amount of memory allocation.