This message was deleted.
# helpdesk
s
This message was deleted.
a
I’m digging deeper:
Copy code
tt.util is undefined
p
hi @astonishing-psychiatrist-47491, can you give us more context about your build pipeline? Also: when does this error occur? and can you enable source maps?
a
Build pipeline is tricky, yes 🙂 It’s clojurescript with shadow-cljs. It’s working with all npm UMD packages that I tried so far… I’m trying to figure out what’s root problem here, but without success so far…
Also: when does this error occur?
during “loading” of module (it uses Google Closure for this)
if you are interested in an investigation (I understand that it’s not very popular combination of tools 🙂 ) I can make a minimal reproducer.
p
sourcemaps would be the most valuable help right now in order to see where the error actually originates from. is this a runtime error or does it happen during your build ?
a
it’s runtime error during dynamic module loading . I’m trying to get line with applied sourcemaps, again without success so far (I guess because there is “two levels” of source mapping in my environment). But looks like it’s _m0.util.Long references
p
aha! the two libraries that impact that are
Copy code
import Long from "long";
import _m0 from "protobufjs/minimal";
it does sound like
_m0.util
is undefined however.. no idea how that would happen. fyi we do have a rollup script that removes all occurrences of
eval
in the source code and replaces them with
undefined
. maybe that helps you with finding the culprit!
a
Thank you. So far I tried to switch to esm, it didn’t help, I’m still getting “TypeError: _m0.util is undefined”
fyi we do have a rollup script that removes all occurrences of
eval
in the source code and replaces them with
undefined
thank you for the clue!
rollup (?) generates
Copy code
var _m0 = /*@__PURE__*/getDefaultExportFromCjs(minimalExports);
minimalExports is empty object at this point
while minimal$1 looks good
maybe you know what is in charge of all this getDefaultExportFromCjs build magic? ) thank you!
Ok, looks like the issue was fixed here https://github.com/rollup/plugins/pull/1455 Updating @rollup/plugin-commonjs to 24.1.0 fixed my issue
🎉 1
Any chance to merge this update into the lib?
p
sure, we’ll get this in as part of the next release!
a
thank you! I’m happy so far with my fork with bumped dependency. BTW, have you deliberately designed client-sdk-js API after Twilio API? Anyway, it helps a lot to switch from Twilio 😉