Fork me on GitHub
#shadow-cljs
<
2021-06-02
>
7e2710:06:24

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?

7e2711:06:37

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

alexdavis18:06:19

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

alexdavis18:06:57

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

thheller18:06:32

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

thheller19:06:16

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

alexdavis19:06:10

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

alexdavis22:06:21

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