figwheel-main

octahedrion 2022-09-07T12:25:17.885599Z

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 ?

athomasoriginal 2022-09-07T15:40:34.625619Z

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

octahedrion 2022-09-07T16:04:44.968469Z

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

octahedrion 2022-09-07T16:04:55.387159Z

(as I explained above)

octahedrion 2022-09-08T07:32:32.213719Z

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

octahedrion 2022-09-08T07:40:09.004369Z

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