typescript Lodash import spins CPU

22 views
Skip to first unread message

Steve Buikhuizen

unread,
Mar 20, 2025, 7:18:22 PMMar 20
to Illuminated Cloud Q&A
I have noticed that using the Lodash lib in typescript is not viable when illuminated cloud is active. Any import from it causes intelligence to consume all CPU.

If I disable illuminated cloud then the problem goes away. These typescript sources are not part of a salesforce project but that doesn't affect the problem as it's a blocker for all other projects.

Import can be for any function from Lodash but here is the one that initially manifested the problem.

import { cloneDeep } from "lodash";

Has anything like this been reported by any other users?

I can work around it by disabling illuminated cloud but given that typescript is now a part of the salesforce ecosystem this is not a good long-term solution.

Scott

unread,
Mar 20, 2025, 7:20:34 PMMar 20
to Illuminated Cloud Q&A, steve.bu...@gmail.com
Hi, Steve. Yes, another user ran into this and it appears likely to be a JetBrains issue, but one that only occurs when IC is also installed. I've logged an issue with JetBrains:


and their response so far is to enable Settings | Languages & Frameworks | TypeScript | TypeScript language server | Use types from server. The never-ending analysis is in their own type inference engine that it seems they're starting to move away from.

Let me know if that doesn't help.

Regards,
Scott Wells

Steve Buikhuizen

unread,
Mar 20, 2025, 8:03:56 PMMar 20
to Illuminated Cloud Q&A, Scott, Steve Buikhuizen
Okay thanks, I'll give this a try.

Do you have any information on what I would lose by disabling this feature maybe some kind of LSP capabilities?

Scott

unread,
Mar 20, 2025, 8:10:19 PMMar 20
to Illuminated Cloud Q&A, steve.bu...@gmail.com, Scott

I’m not sure that you lose anything. Ultimately it’s just a matter of which engine is being used for type inference, and it sounds like JetBrains is admitting that the one from the language server — which is always running even if it looks disabled for a few reasons — is better than their own based on this comment from JetBrains:

We are currently working mostly on WebStorm with the enabled “Use types from server” / ”Service-powered type engine” (new name in 2025.1)

All of the other TypeScript IDE capabilities should continue to work exactly as you’d expect with that option enabled.

Regards,
Scott Wells

Steve Buikhuizen

unread,
Mar 22, 2025, 1:26:34 AMMar 22
to Illuminated Cloud Q&A, Scott Wells
It helped for a few mins and then the spin came back again.

Only workarounds appear to be avoid Lodash or disable IC.

I can disable for now since we are not yet using typescript in IC.

Can I provide any logs that will help you grok/fix?

Scott

unread,
Mar 22, 2025, 11:53:58 AMMar 22
to Illuminated Cloud Q&A, steve.bu...@gmail.com, Scott
Well that stinks. This is actually something I'm able to reproduce locally, so I've gathered diagnostic information. Unfortunately while it's true that it only happens when IC is installed/enabled, nothing in the diagnostics actually show any contribution from IC. I've included all of that in the linked JetBrains issue if you're curious. I'll note in that issue that enabling types from the language server did not provide a lasting solution, and hopefully I can get JetBrains to see if they can help provide at least some pointers around what IC is doing here since it doesn't show up in logs, profiling snapshots, etc. Please keep an eye on the linked YouTrack issue for updates.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages