Fork me on GitHub
#figwheel-main
<
2022-09-07
>
octahedrion12:09:17

I'm trying to use some JS code which is intended for use with node.js (client-side code) but I'm not keen on using node and would prefer to use figwheel to shadow-cljs, but I'm getting Uncaught SyntaxError: import declarations may only appear at top level of a module from one of the dependencies in my :foreign-libs . Must I give in or is there some hope that I could get it working with figwheel ?

athomasoriginal15:09:34

What are you trying to do? That error doesn't seem related to figwheel.

octahedrion16:09:44

well, I'm trying to use :foreign-libs which would normally be used with shadow-cljs as node.js modules

octahedrion16:09:55

(as I explained above)

octahedrion07:09:32

in case anyone reads this, I think that error was caused by trying to use JS code which needs to be transformed as with https://clojurescript.org/reference/javascript-library-preprocessing -- I can't find in Figwheel's documentation whether it supports this

octahedrion07:09:09

specifically, code that has import { Something } from '../path/to/Something.js'; needs to be transformed to resolve its dependencies which requires that preprocessing step. No mention of preprocessing on http://figwheel.org that I could find