Shadow-cljs is giving namespace error

_$ shadow-cljs watch modern-cljs_

Error Prompt:

Invalid Filename, got cljs/modern_cljs/core.cljs but expected modern_cljs/core.cljs (or .cljc)

My shadow-cljs.edn file:

    {:source-paths ["src"]
     :dependencies []
     :builds {:modern-cljs {:output-dir "public/js"
                            :asset-path "/js"
                            :target :browser
                            :modules {:main {:entries [modern-cljs.core]}}
                            :devtools {:http-root "public"
                                       :http-port 8080}}}}

Directory Structure (inside modern-cljs folder):

build.boot package.json public shadow-cljs.edn src

index.html  js

cljs-runtime  main.js  manifest.edn



core.cljs  login.cljs

As the error shows the expected filename is modern_cljs/core.cljs but you have cljs/modern_cljs/core.cljs. So you should be using :source-paths ["src/cljs"]. The expected name is expected to be found on any of the :source-paths or in your :dependencies.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.