Hello, I use _ lodash in function, when I run it on web app, it work well. but when I run it on mobile(retool app on samsung), it show _ is not defined.
Hey @AnsonHwang
I think its not a bug have you try in any component of mobile app?
I tested it in the JSON editor in Retool, and Lodash seems to be working perfectly there.
Thanks for reaching out, @AnsonHwang! Which lodash
method are you trying to use? I just tested this with _.chunk
and it seems to run both in the web editor and on my iOS device.
I use _.map, it show error hint on mobile console " _ is not defined".
My phone is samsung.
what I mean is on "retool" app(apk) not on chrome mobile.
pls run it on your android mobile, you will get error
I checked on mobile as well, and everything seems to be working perfectly. Since you mentioned wanting to verify the _.map
method from Lodash, I looked into it, and it's functioning as expected
{{ _.map(_.chunk(['a', 'b', 'c', 'd'], 2), (group, index) => `Group ${index + 1}: ${group.join(', ')}`) }}
I can ask somebody on the team with an Android device to test this out, @AnsonHwang. I'll let you know what they find.
In the meantime, are you adding any other custom JS libraries to your app? It's possible that some corollary error is preventing lodash
from loading correctly.
This is a common issue when using Lodash (_
) in Retool mobile apps — the mobile runtime environment may not auto-include Lodash like the web does. A quick fix is to explicitly import Lodash at the top of your JS code using const _ = require("lodash");
if the environment allows. Otherwise, consider rewriting the logic using native JS methods for better mobile compatibility.
That's interesting, @Levi_Ezra! Welcome to the community. Is this something you've seen before, then? Neither I nor my coworkers with Android devices have been able to reproduce the issue, but I agree that explicitly requiring
lodash
should be an effective workaround.