Fork me on GitHub
#shadow-cljs
<
2020-02-16
>
Gleb Posobin06:02:29

How do I set web-accessible-resources with shadow for chrome-extension target? I want to include a content script css file. https://stackoverflow.com/questions/11553600/how-to-inject-css-using-content-script-file-in-chrome-extension

thheller08:02:34

you put it into the manifest?

👍 4
Gleb Posobin15:02:31

Wow, that worked, thank you.

rberger07:02:20

@UQ4RJ22EA Im having the same problem and I tried putting it into the manifest.edn but it didn't work. The manifext.json was malformed I had tried:

:content-scripts [{:css ["re-frame-modal.css"]}]
and
:content-scripts {:css ["re-frame-modal.css"]}
neither produced manifest.json that was accepted by chrome extension loading. I could manually set the manifest.json and that would work. Could you show me what you put in the manifest.edn to get the css file to be accepted? Thanks

Gleb Posobin17:02:05

:web-accessible-resources ["assets/content-style.css"]
:content-scripts [{:css ["assets/content-style.css"] :matches ["<all_urls>"]}]

rberger22:02:44

Thank you that worked great!

joshkh13:02:00

has anyone had success importing react-dnd? https://github.com/react-dnd/react-dnd my build fails when i require the necessary packages

["react-dnd" :refer [DragDropContext DropTarget DragSource DragLayer]]
with the following build failure
[:app] Build failure:
The required JS dependency "domain" is not available, it was required by "node_modules/@react-dnd/asap/dist/cjs/node/raw.js".

Search in:
	/Users/josh/src/rodeorockstar/genpoetry/node_modules
You probably need to run:
  npm install domain
i've also manually added domain yarn add domain and tried to require it directly with the same error message as above

thheller15:02:41

@joshkh you need to install shadow-cljs in the project

joshkh16:02:06

not sure how i missed that. thanks @thheller, that did the trick

thosmos19:02:40

I just started getting an error about a CLJC file not finding itself to import macros from:

Failed reading cache for theta.log: failed to require macro-ns "theta.log", it was required by "theta.log"
The file is like:
(ns theta.log
  #?(:cljs (:require-macros [theta.log]))
This just started. Is this a cache problem?

thosmos19:02:11

oh, removing the caches helped uncover an error in a macro that was hidden by the cache fail error