Fork me on GitHub
#shadow-cljs
<
2024-05-29
>
Mor Gazith14:05:50

hi again, anyone here had luck using the new https://github.com/InboxSDK/InboxSDK lib that supports chrome manifest V3 (https://inboxsdk.github.io/inboxsdk-docs/#quick-start)? i’ve added @inboxsdk/core to package.json, and require it like so:

(:require ["@inboxsdk/core" :as inbox-sdk])
when running shadow-cljs i get:
Failed to inspect file .../@inboxsdk/core/inboxsdk.js

Errors encountered while trying to parse file
  .../@inboxsdk/core/inboxsdk.js
  {:line 1, :column 1, :message "The file could not be parsed as JavaScript."}

RuntimeException: Exception parsing ".../@inboxsdk/core/inboxsdk.js"
...
Caused by:
IllegalArgumentException: Must call rewindTo before calling getSourcePosition for an earlier line (1160185 < 1171698)
i understand the exception is from google closure, but don’t understand how it can be resolved, inboxsdk.js seems like a valid js file to me.

thheller14:05:21

could be a closure compiler bug. what is the full error?

thheller14:05:51

ah just looked at the package. you'll need to use webpack for this. shadow-cljs does not support this kind of build setup where the files are webpack specific

Mor Gazith15:05:22

how can you tell this package is webpack specific? and any pointers on how to require it via webpack?

Mor Gazith15:05:44

and thanks again for immediately jumping on my questions, i really appreciate it!

thheller15:05:25

well I'm not actually sure. it might just be a closure compiler bug.

thheller15:05:03

if you setup a repro I can take a closer look

Mor Gazith15:05:49

I'll try doing that, thanks!