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?Never mind. The problem was me using bad keytool
invocation, I should just RTFM I guess - sorry:)
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 FWIWThe shadow guide seems to suggest that this should be fine though so not sure whats going wrong
looks fine. any other errors before that one? that one might just be a symptom not the cause?
oh and I'm assuming this is a browser target?
Yes browser target, no other errors. I’ll put together a minimal reproducible example tomorrow, was just wondering if I was doing something silly…
Ok this is bare minimum to reproduce https://github.com/armincerf/clojurescript-serverless-framework/blob/build-failure-requiring-js-file/src/todo_mvc/core.cljs
Javascript components are here https://github.com/armincerf/clojurescript-serverless-framework/tree/build-failure-requiring-js-file/src/components
js files generated by babel --plugins @babel/plugin-transform-react-jsx src/components --out-dir src/gen --watch
are here https://github.com/armincerf/clojurescript-serverless-framework/tree/build-failure-requiring-js-file/src/gen
There's definitely still a possiblity this is just me not understanding something fully, but I'm pretty sure this should work