I'm getting a "ReferenceError: _ is not defined" on a .map call like this:
arr.map(async (elem) => {
...
});
There doesn't appear to be any explicit mention of "_" anywhere here. When I look at the source of the error, I see:
eval
webpack-internal:///./src/components/admin/NameOfMyFile.tsx (115:51)
step
node_modules/tslib/tslib.es6.js (102:0)
Object.eval [as next]
node_modules/tslib/tslib.es6.js (83:45)
asyncGeneratorStep
node_modules/@swc/helpers/src/_async_to_generator.mjs (3:0)
_next
node_modules/@swc/helpers/src/_async_to_generator.mjs (25:0)
eval
node_modules/@swc/helpers/src/_async_to_generator.mjs (32:0)
The only lead I have here is that it seems to be trying to use something in tslib.es6.js but in my tsconfig.json, my "target" is "es5". Not really sure if this plays a role or just a red herring.
I'm on Next.js and this is done on the client side. (On the server side, it doesn't appear to have any problems)
Would love some help here if anyone has any ideas. Thanks!