0

An error message in my browser has informed me that:

ClojureScript could not load :main, did you forget to specify :asset-path?

According to the documentation, :asset-path is a compiler option. What is the correct place in my leiningen configuration file for a compiler option such as :asset-path? It doesn't seem to work at the top level.

The project is freshly generated using this command:

lein new figwheel-main <name> -- --reagent

I'm hosting the website on my own server, with the output files hosted at /static/cljs-out, hence the need for the :asset-path option.

Leiningen version is 2.9.1, figwheel-main version is 0.2.16

BnMcGn
  • 1,440
  • 8
  • 22
  • Without sharing the project, it's hard to guess correctly. This is the config for figwheel-main: https://figwheel.org/docs/compile_config.html and this for clsj-build with leiningen (examples with compiler options): https://github.com/emezeske/lein-cljsbuild#multiple-build-configurations – cfrick Feb 05 '22 at 16:04

1 Answers1

0

The :asset-path option can be placed in the build specific configuration file, dev.cljs.edn in my case. This file is found in the project's root folder.

^{:watch-dirs ["test" "src"]
  :css-dirs ["resources/public/css"]
  :auto-testing true
   }
{:main flaglib2.core
 :asset-path "/static/cljs-out/dev"}

This answer is possibly specific to figwheel-main projects. The rules seem to be different for cljs-build projects, as per cfrick's comment above.

BnMcGn
  • 1,440
  • 8
  • 22