Re https://shadow-cljs.github.io/docs/UsersGuide.html#_access_cljs_from_js: What if the CLJS namespace contains dashes? E.g. for this import
import testjs from "goog:example.test-js2"
I get error:
[:app] Build failure:
Closure compilation failed with 1 errors
--- example/test4.js:1
Required namespace "example.test-js2" never defined.
If I remove the dash from the namespace name and namespace import, all works fine.In js, try an underscore where cljs has the dash
I tried but got yet some other error
[:app] Build failure:
Namespace module$example$testcljsjs2 required example.test_cljsjs1, but the target is example.test-cljsjs1
I attach files that generated this erroragain, if I remove - from the namespace, all works just fine
I do not recommend using this feature. it has very many issues and you will be on your own debugging them
if you must write JS code it is better to write it as a goog.module, but best to stick with just CLJS 😛
Required namespace "example.test-js2" never defined. you get because JS files cannot use - in their names as that would map to example.test-js2 variable name which is example.test - js2, as in an actual minus operation. not a valid name.
How can I use goog.module? I couldn't find anything in shadow book about it
You probably mean what is under described under https://shadow-cljs.github.io/docs/UsersGuide.html#_modules. Am I correct?
no, it is the format used by the google closure library/compiler
has nothing to do with shadow-cljs specifically
what are you trying to do? they might not actually do what you need, so kinda need more details