binaryage / chromex

Write Chrome Extensions in ClojureScript
Other
411 stars 21 forks source link

Can't use datascript at the same time in popup and background #20

Open yqrashawn opened 3 years ago

yqrashawn commented 3 years ago

There's a datascript not defined error in popup page if I put datascript.core/create-conn in both background.core and popup.core. Once I deleted the datascript code in background.core, the error went away and datascript works in popup.

Can be reproduced in shadow example as this commit.

https://github.com/yqrashawn/chromex/commit/e66dc616

Is this the supposed way and I misunderstand some concepts in chrome extension or shadow-cljs?

qazwsxpawel commented 3 years ago

I've been seeing similar behaviour with some other libs/requires too. E.g. the storage api or reagent. Is this some limitation for chrome extensions in general or maybe there is something in shadow build config that could solve this? Thanks!