Fork me on GitHub
#shadow-cljs
<
2019-04-25
>
Daniel Hines01:04:15

I’m developing an add-in for Excel. I’m currently on Mac, so my JS runtime appears to be an embedded Safari. When I load the page in Excel, Shadow tells me there was a websocket error. This is the only thing in the logs:

shadow-cljs: websocket error – Event
Selected Element
<html>…</html>

Daniel Hines01:04:28

Any ideas on how to troubleshoot this?

Daniel Hines01:04:22

Oh, this may be important: I’m serving the app over a different http server that’s using SSL (not using the built in shadow server)

Daniel Hines01:04:39

Problem solved (or, sidestepped, anyway). I found out I didn’t need https in the first place. When served over http with shadows built in server, everything works fine.

thheller07:04:38

yeah if you serve over https you need to configure https for the shadow-cljs server as well

deplect13:04:03

Goodday everybody, I am working on getting my tests running automatically on every change. The combintaion of shadow-cljs watch test and a :autorun true should allow for test to run automatically no? After rebuid

thheller14:04:18

@deplect assuming you are using :target :node-test for the :test build config yes

deplect14:04:45

@thheller yes I am using this, but no autotest on change. Now configured with an npm watch. Tried many combinations but did not succeed. The test do not run on a shadow-cljs watch test

deplect14:04:25

It this is not intended, I will try to get that working.

thheller14:04:09

would help to see your config and test

thheller14:04:17

it is intended to work of course

deplect14:04:03

I will post it as a gist one moment

thheller14:04:10

output may be going to the wrong process if you have a shadow-cljs server instance running

thheller14:04:16

not sure that is managed properly

deplect14:04:55

I have one watch dev running and a watch test

deplect14:04:16

let me close the watch dev

thheller14:04:42

you can run shadow-cljs watch dev test to run two targets in one process

deplect14:04:21

@thheller wonderfull, learning something everyday :-)😎

thheller14:04:31

;; remove :dev alias on production deploy
 :deps {:aliases [:dev]}

thheller14:04:50

shadow-cljs -A:dev watch dev test also conditionally sets the alias

deplect14:04:30

thank you again @thheller, I discovered the -A flag but now can use it

thheller14:04:14

hmm yeah I tested. the :autorun process is directed to the wrong output

deplect14:04:57

I get a test output when I run both dev and test

deplect14:04:29

so seems to work here

souenzzo15:04:56

How to find why cljs.pprint is present in my final bundle?

thheller15:04:58

select the build, compile it and there is a little util in the bottom

thheller15:04:21

select box with all the namespace from the build

thheller15:04:32

select cljs.pprint and it'll tell you who included it

thheller15:04:04

UI sucks but answers that question 😉

❤️ 8
tony.kay18:04:45

when upgrading from 2.8.3 to 2.8.33 I get a babel error on semantic-ui-react. I’ve tried pinning babel to the version in that library, but it doesn’t help…any ideas why this would break on this upgrade?

tony.kay18:04:18

Trying versions in between. 2.8.20 seems to work

tony.kay18:04:48

looks like .26 was the latest version that worked

tony.kay18:04:36

so it looks like .27 had some changes to configurability of babel…but I see no docs on it anywhere. Any suggestions on what options might fix it to work like .26?

thheller19:04:35

@tony.kay please expand on "babel error" ... no clue what that means

thheller19:04:40

I indeed upgraded babel to a newer version so totally possible that something that worked before doesn't work anymore

thheller19:04:42

semantic-ui-react compiles and loads fine for me so some more details are required:P

tony.kay20:04:47

@thheller

[:main] Compiling ...
/Users/tonykay/owsy/gondola-client/.shadow-cljs/babel-worker/babel-worker.js:3497
!0,Hg.Ya="cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers243717",Hg.Hb=function(b){return Vb(b,"cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers243717")};return new Hg(a,oe)}function Oi(a){try{var b=a[0];return b.l?b.l(a):b.call(null,a)}catch(c){if(c instanceof Object)throw b=c,a[6].qb(null),b;throw c;}}function Pi(a,b){b=Hi(b,Ni(function(c){a[2]=c;a[1]=4;return Oi(a)}));return z(b)?(a[2]=H(b),a[1]=4,vh):null}
                                                                                                                                                                                                                                                                                                                    ^

TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at d (/Users/tonykay/owsy/gondola-client/.shadow-cljs/babel-worker/babel-worker.js:1790:192)

tony.kay20:04:09

babel failed?
{:file "/Users/tonykay/owsy/gondola-client/node_modules/semantic-ui-react/dist/es/lib/AutoControlledComponent.js"}

tony.kay20:04:17

babel runtime installed is 7.3.1 in node_modules

tony.kay20:04:39

SUI wants 7.1.2, and I’ve tried pinning that…but it does not seem to help

thheller20:04:24

@tony.kay which semantic-ui version?

thheller20:04:31

I somehow doubt that this is related to the babel runtime since that is not what is compiling all of this

martinklepsch20:04:56

I'm having an interesting situation where a node script never exits despite clearly being done. But once I kill the shadow-cljs worker it exits.

martinklepsch20:04:09

And prints "REPL client disconnected"

tony.kay21:04:53

@thheller semantic-ui-react 0.85.0

tony.kay21:04:43

package.json is

{
  "dependencies": {
    "keycloak-js": "^4.8.3",
    "element-resize-detector": "^1.1.14",
    "intl-messageformat": "^2.2.0",
    "karma": "^4.0.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-cljs-test": "^0.1.0",
    "lodash": "^4.17.11",
    "natives": "^1.1.6",
    "raven-js": "^3.25.2",
    "react": "^16.4.1",
    "react-autocomplete": "^1.8.1",
    "react-dom": "^16.4.1",
    "react-icons": "^2.2.7",
    "react-number-format": "^4.0.5",
    "react-transition-group": "^2.2.1",
    "reakit": "^0.11.2",
    "semantic-ui": "^2.3.1",
    "semantic-ui-react": "^0.85.0",
    "shadow-cljs": "2.8.26",
    "showdown": "^1.8.6"
  }
}

thheller21:04:23

@martinklepsch the websocket connection will keep the node process alive. set :devtools {:enabled false} if you want your process to exit when done.

tony.kay21:04:37

interestingly, there is this warning when using .26 of shadow (which works):

------ WARNING #1 -  -----------------------------------------------------------
 Resource: node_modules/semantic-ui-react/dist/es/lib/AutoControlledComponent.js:269:2
 JSDoc annotations are not supported on return.
--------------------------------------------------------------------------------

tony.kay21:04:42

which is the same file that 27 barfs on

thheller21:04:41

27 was the first version to use the babel v7 version I think

martinklepsch21:04:42

@thheller thanks — what do I lose by disabling the devtools for a node script?

thheller21:04:58

nothing if you didn't use them in the first place 😉

thheller21:04:09

websocket connection is providing the REPL and hot-reload stuff

thheller21:04:25

which is not very useful if you are building CLI type scripts

thheller21:04:36

since you actually want them to exit when done

martinklepsch21:04:38

right — I do use the node repl a lot but I guess that will still work...

martinklepsch21:04:46

thanks for the quick answer, much appreciated 🙌

thheller21:04:16

hmpf this is frustrating. the file compiles just fine for me without any issues

thheller21:04:56

ha! no it fails

thheller21:04:36

@tony.kay FWIW setting :js-options {:babel-preset-config {:safari 11}} fixes it. checking why it fails without config.

🤕 4
currentoor21:04:30

is there a way to start the server & watch all the builds?

currentoor21:04:51

in one command

thheller21:04:03

shadow-cljs watch all your builds

thheller21:04:47

there should maybe be a --all switch or so. listing all the build ids may be tedious 😉

thheller21:04:32

@tony.kay :js-options {:babel-preset-config {}} also fixes it ... I guess TypeError: Invalid value used as weak map key is the equiv of a NullPointerException

thheller21:04:00

will release fix that doesn't pass null to babel shortly

tony.kay21:04:10

cool, thanks 🙂

thheller22:04:43

should be fixed in 2.8.34

👍 4
tony.kay22:04:47

confirmed working

👍 4