Fork me on GitHub
Mark Bailey05:04:56

Hello! anyone have any experience with shadow-cljs and tailwindcss?

Mark Bailey05:04:20

I am having trouble getting tailwindcss to load and be usable


Hi all, anyone had any luck getting shadow-cljs, deps.edn and cider working nicely together? Things work perfectly just using shadow-cljs and cider but when I try to use deps.edn as well the cider-jack-in-cljs stops working. I select cider-jack-in-cljs -> clojure-cli and then my build and I get the following error. error in process filter: The shadow-cljs ClojureScript REPL is not available. Please check for details


@sofra that is not an error from shadow-cljs and I can't help with the cider parts sorry


@thheller yep understood, I will take it over to #cider


should be easy to do though. just add shadow-cljs to deps.edn and then start as normal


all the shadow-cljs stuff is working fine


@mbbailey96 whats the issue? you just load the tailwind css file? shadow-cljs doesn't need to know anything about that?


just the cider integration that breaks


yeah dunno about cider. I use Cursive.


no problem

David Pham07:04:58

I usually use cider-connect-cljs

David Pham07:04:13

I launch a watch process

Mikko Harju09:04:09

Question about I'm getting Cannot infer target type in expression (. c__41761__auto__ -ratomGeneration) when using r/with-let -form in reagent (in a react native project). The article would suggest that I should be use to tag it using ^clj but this does not help. Is this a known issue? I can always revert back to (let [] (fn [] ...)) and it works.


the problem is in the code the macro generates. so you cannot typehint it properly without modifying the lib


but wasn't that fixed? I thought it was fixed in newer reagent versions?


In what case does this happen? I'm running Reagent test suite with Shadow-cljs and extern inference so it should be okay.


But this probably requires version 0.9.1

Mikko Harju09:04:40

OK, maybe I need to update my libs then

Mikko Harju09:04:16

Yeah, this project is at 0.8.1, I'll update it. Thanks for your fast replies!


Yeah, and that change was released in 0.9

Mikko Harju09:04:18

Updated reagent to 0.9.1 and it works. Thanks!

Mark Bailey14:04:23

@thheller I am getting a js-invalid-requires message on watch, specifically pointing out a require located in the index.js file of tailwindcss. Docs recommended an NPM install of tailwind so that's what I did. When I view the app in browser, it give me "failed to load" errors again citing the 'require not defined'. I tried changing :js-options :js-provider to :require but that only fixed some of the issues. It's the closest I've gotten to a working build


@mbbailey96 I like the shadow-cljs + tailwindcss workflow described in this YouTube video:

Mark Bailey14:04:51

@iradavidhale, so do I! That's where I got the idea for tailwind from, but if you look at his git repo, he has the pulled tw css file already, not the node_modules. Errors like the ones I described above are only happening when I import the tailwind node module. Also, @thheller, I forgot to mention. I get the same failed to load in browser for



@mbbailey96 I don't know what you are trying to do. tailwind is a css file and doesn't have JS?


you include it in your HTML. your CLJS build doesn't know anything about it?


meaning you do NOT require it in your CLJS sources?

Mark Bailey14:04:45

As far as I understand when reading through the install docs on the official tw website, it calls for an install through npm or yarn, then adding @tailwind base (and others) to your site.css file.


for the tailwind tools yes


that creates a .css file for you

Mark Bailey14:04:20

Ah, then I gravely misunderstood the task at hand. Sorry to bother you @thheller


you load that in your html via <link rel="stylesheet" href="/css/whatever.css">


or you just skip the custom build stuff and just use <link href="" rel="stylesheet">

Mark Bailey14:04:20

Yep! Just read further into the site, and found that little gem.

Mark Bailey14:04:30

My apologies, didn't mean to ask stupid questions


Is there anything that would prevent shadow from loading a cljs namespace in a resources/ path? I have resources as a source path in my deps.edn and :deps true in shadow-cljs.edn but when I try to require public.code.myns which is located in resources/public/code/myns.cljs I'm getting "The required namespace "public.code.myns" is not available"


@jjttjj well is it (ns public.code.myns)?


oh right. resources/public is filtered by default because it is were people usually output there code to


dunno why you'd put actual code there?


Yeah, kinda a weird situation where I have static code files I wanted to eval with a bootstrapped compiler, there are probably better ways to do it but I was doing it this way as a shortcut for now


(and I was trying to get them to auto-reload)

Ivan Fedorov20:04:20

Been getting lots of those recently Internal compiler error


internal compiler error from the closure compiler


not shadow-cljs

Ivan Fedorov20:04:06

could be ES6 forms again?


why are you writing so much JS? đŸ˜›

Ivan Fedorov20:04:15

the opposite – porting some legacy))


I haven't worked in direct JS support in a while so I imagine that it has several issues


closure is fairly strict in the kind of code it accepts

Ivan Fedorov21:04:13

Yes. This time adding terminating semicolons helped.

Ivan Fedorov21:04:12

Nope, premature celebration, still digging the sources.

Ivan Fedorov21:04:38

But yeah, that’s something about Closure, not Shadow


@thheller Is it possible to programatically configure shadow-cljs.edn when it is loaded by shadow-cljs?


I would like to be able to set :devtools-url based on my current ip