shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
7e27 2021-06-02T10:19:24.309100Z

I’m trying to use the :dev-http with :ssl. The build is succesfull, and shadow-cljs logs “HTTP server available at https://localhost:3000”. I get curl: (35) error:14004410:SSL routines:CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure. My shadow-cljs.edn file looks like this:

{:dependencies [[reagent "1.0.0"]
                [re-frame "1.2.0"]]
 :source-paths ["src"]
 :nrepl {:port 4444}
 :ssl {}
 :dev-http {3000 "public"}
 :builds
 {:app {:target :browser
        :output-dir "public"
        :asset-path "/"
        :modules {:app {:init-fn hello.core/init}}}}}
Am I missing something?

7e27 2021-06-02T11:10:37.310900Z

Never mind. The problem was me using bad keytoolinvocation, I should just RTFM I guess - sorry:)

alexdavis 2021-06-02T18:38:19.315500Z

I am trying to use some JSX components in a cljs project. I'm following the shadow user guide and have babel processing my .tsx files and outputting .js files. This works totally fine, unless I try and import a file that requies another js file. So this works without issue:

'gen/Button.js'
...
import React from 'react';

export const Button = ({
  primary = false,
  label,
  ...props
}) => {
  const mode = primary ? "text-primary" : "dark:text-white";
  return /*#__PURE__*/React.createElement("button", _extends({
    className: "font-extralight " + mode
  }, props), label);
};
But this fails
import React from 'react';
import { Button } from './Button.js';
export const Header = ({
  onCreateAccount
}) => /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement("div", {
  className: "wrapper"
}, /*#__PURE__*/React.createElement(Button, {
  primary: true,
  size: "small",
  onClick: onCreateAccount,
  label: "Sign up"
})));
with the error
Header.js:8 Uncaught ReferenceError: Button$$module$gen$Button is not defined
This is all the cljs needed to cause the error
(:require ["../gen/Header.js" :refer (Header)])
It all works from a JS project FWIW

alexdavis 2021-06-02T18:38:57.315900Z

The shadow guide seems to suggest that this should be fine though so not sure whats going wrong

thheller 2021-06-02T18:40:32.316400Z

looks fine. any other errors before that one? that one might just be a symptom not the cause?

thheller 2021-06-02T19:00:16.316900Z

oh and I'm assuming this is a browser target?

alexdavis 2021-06-02T19:58:10.318200Z

Yes browser target, no other errors. I’ll put together a minimal reproducible example tomorrow, was just wondering if I was doing something silly…

alexdavis 2021-06-02T22:45:21.321100Z

There's definitely still a possiblity this is just me not understanding something fully, but I'm pretty sure this should work