Error: Cannot find module 'lodash'

I'm a retool noob. We've begun to see this is some workflows that previously worked fine. lodash is listed in the libraries for the workflow. I have no idea what the issue is.

Error evaluating startTrigger: Error: Cannot find module 'lodash'
Require stack:
- /retool_backend/bundle/workflowCodeExecutor/dist/runMultipleBlocksHandler.js (line -41)

Hi @steve.troxell.fbg, welcome to the forum! :wave:
Could you share a screenshot of the JS block where we are using the library?

I don't really know where it is being used. Whenever we create a new workflow, we get these libraries by default
image

If I try to run the workflow, the startTrigger fails:

'--- Running query: startTrigger ---'
Tue 2024-07-09 16:00:29

Error evaluating startTrigger: Error: Cannot find module 'lodash'
Require stack:
- /retool_backend/bundle/workflowCodeExecutor/dist/runMultipleBlocksHandler.js (line -5)
Tue 2024-07-09 16:00:29
--- Failed running query: startTrigger ---
Tue 2024-07-09 16:00:29
--- Hit failure, skipping queries: GetUserSegments, CheckForError, GetDestinationAccountSegments, ChangesCollection, GetChanges, BuildUpdateRequest ---

I don't really know how/where to dig further to where this is happening. What we've been doing is deleting all those libraries and our workflows stop erroring.

Hi @steve.troxell.fbg,

Thanks for reaching out. Are you on-prem (if so, what version are you on?) or on cloud?

Can you check on the sidebar if you have a cog named "Settings"? If so, can you click "JavaScript Configuration" and see if there is a require statement for lodash there and try removing it?

If you don't see the Cog or "JavaScript configuration", can you click on the lodash library in the libraries tab (the same tab as in your screenshot) and check if there is a require statement there for lodash and try removing it?

Does this issue occur on newly created workflows?

Thanks,
Colin

We are self-hosted and version is 3.52.1. I am not an admin user.

There is no "Settings" cog in the workflow sidebar.

This is what I see when I open the lodash library in the "Libraries" tab

If I comment out that const _ = require('lodash') line, I stop getting the lodash error. But I just get the same error on the next library in the list.

Is removing the "require" line any different than just deleting the library from the workflow altogether? That's what we've been doing.

Yes, this issue occurs on newly created workflows. They are created with all those libraries in place.

Getting random workflow failures in steps…

This in a branch step?! (Lodash is included by default in the workflow):

A very simple DB query:

All errors just after 2024-06-19 08:00 +10:00

Hi @hansontools, could you share a screenshot of the branch block?

Sure:

JS setup:

JS libs:

Are you also on Self-hosted Retool? I made a WF similar to yours but I'm not running to this issue on Cloud.

Cloud hosted.
It was an intermittent error. It's gone now (but the logs remain, which is why I can show you).

Just seems that's a big underlying problem that affected all my workflows for a period of time. There'd be nothing I can do about it is, is the concerning part.

Thank you for expanding on it! Our engineers are looking into what could've caused this. Please send the logs in a DM to me.