Fork me on GitHub

Hello, I have a question about debugging release build. So I deployed my app to server and I'm running into an error there which isn't present on my local dev build. My problem is that I have no idea how to go about debugging it on the server, mainly due to the fact that the build is minified, there is no source maps, there is no re-frame-10x, etc. you get the point. I'm wondering if someone can give me some pointers on how to build a version that I can deploy to server without all these limitations. I'm using Shadow Cljs, if that helps. Thanks!


@nedim you can run shadow-cljs release app --debug or shadow-cljs release app --pseudo-names. first is pseudo-names + source maps, second is just pseudo-names. both make debugging much easier


or just :compiler-options {:source-map true} in the build config to enable source maps in general for your release build


and I recommend just doing a release build locally and work on it there. no need for it to go to actual production server with what is likely an externs issue

👆 2

@U05224H0W Perfect, thank you so much!


seconding pseudo names! It turns the names from obscure minified names like fA and b to $myapp$mything$$.actualFunctionName$. The dollar signs indicates that it's a name that would be minified when you run without pseudo names. Then you at least have some idea about what part of the code that fails 🙂

👍 2

I have a data like below

[{:person-name "john"
    :person-id 1234
    :person-address "Holand"}
    {:person-name "hari"
    :person-id 3456
    :person-address "NY"}] , how can I print the values like 

   person-name person-id  person-address
   "John"       1234       "Holand"
   "hari"       3456      "NY"


Is this acceptable?

(clojure.pprint/print-table [{:person-name    "john"
                              :person-id      1234
                              :person-address "Holand"}
                             {:person-name    "hari"
                              :person-id      3456
                              :person-address "NY"}])

| :person-name | :person-id | :person-address |
|         john |       1234 |          Holand |
|         hari |       3456 |              NY |


but this will print in console not on page


This will print into *out* which you can rebind with binding or with-out-str.


Ah, it's CLJS not CLJ - so it will be *print-fn* and not *out*. But same principle.


@U01J3DB39R6 seems like map-ing over the vector would work. Or do you want to print the column names dynamically based on the map keys?


I wrote it using [:table , and it worked well 🙂

🎉 1
James Amberger18:05:35

no string/format in cljs?


To be fair, there's no string/format in CLJ either. But I guess you meant just format, from clojure.core. :) And yeah, it doesn't exist in CLJS. But there's goog.string.format.

James Amberger19:05:02

Thank you, I think you probably saved me at least an hour on those details.

👍 1

cl-format is also in cljs (but pretty heavy on the code bundle size)