Fork me on GitHub

Q: I’m running a shadow-cljs browser app inside Salesforce. Using one type of integration it loads/works great. Using another I get “shadow-cljs - failed to load 34” in the console. I can see from the generated js that this is loading the npm pdfjs module. Unfortunately that is where the trail ends for me. I can’t work out why it won’t load even when I use the debugger in the fn that calls shadow.provide for that dep - it never seems to invoke that fn


even stranger is that in the first type of integration, it never calls that provide fn either but the app works ok


is there a way of looking deeper into these kinds of load errors?


FYI: the integration that works is a Lightning Component and the one that fails is a Lightning Web Component. That doesn’t mean anything to cljs devs but I mention it for completeness


Hmm: I was able to catch an error in the browser debugger “”Cannot assign to read only property ‘URL’ of object ‘[object Object]’“”


I suspect the Salesforce browser security is suppressing something needed by shadow when loading the pdfjs dep


but I can’t figure out how to stop it from calling this code…


doesn't look like you can stop it. at least I see no flags or anything to do so.


Yeah, I think you are right. Seems like some webpack trickery. I have way around it I can try. Thx


@thheller Thx! Anyway, I'll let you know, when I figured something out.


@thheller re: absolute cljs source path -- I'm transforming source code at the bottom of my namespace (so it runs whenever the namespace is loaded). it's only used for source I'm working on myself. an alternative way of getting the source code would be fine as well 🙂


so you just want to slurp the file?


slurp with (io/resource the-file) should do it


where the-file is a relative path?


that seemed to do it, thanks!


Q: is the compiler option :dump-core ( not supported in Shadow CLJS? It’s not listed in as either supported or not, and it seems the option is not forwarded to the compiler. Is this intentional? Can I affect this through my build settings somehow?


Found the answer in, that this compiler flag is not supported, and we’re supposed to use :target :bootstrap, which doesn’t seem to work (


:target :bootstrap works just fine. just some namespaces seem to cause problems. you don't have to precompile them though either. :dump-core wouldn't do that either.


you can just use :entries [cljs.core] which would be equiv to :dump-core