Fork me on GitHub
#hoplon
<
2016-09-13
>
onetom01:09:48

has anyone seen such error lately: > Could not load content for http://tomplus.local:8100/index.html.out/cljs/core/async/impl/index.html.out/cljs/core/async/impl/timers.cljs : HTTP status code: 404

onetom01:09:22

the index.html.out/cljs/core/async/impl/ part in the path is there twice

onetom01:09:42

as a consequence i can't see .cljs sources in the browser

onetom01:09:43

(show :fileset true) shows this:

├── admin
│   ├── core.cljs
│   └── docs.cljs
...
└── index.html.out
    ├── admin
    │   ├── core.cljs
    │   ├── core.cljs.cache.json
    │   ├── core.js
    │   ├── core.js.map
    │   ├── docs.cljs
    │   ├── docs.cljs.cache.json
    │   ├── docs.js
    │   └── docs.js.map

onetom01:09:15

and my build pipeline is as follows:

(comp
    (watch)
    (speak)
    (environ)
    (hoplon)
    (cljs)
    (from-cljsjs :profile :development)
    (show :fileset true)
    (serve :port 8100))

onetom01:09:06

i guess there is something wrong with the source map generation...

onetom01:09:13

One of the source maps (`/Users/pair/.boot/cache/tmp/Users/pair/ap/fe/163d/6qp7pj/index.html.out/admin/core.js.map`) looks like this:

{
    "version": 3,
    "file": "\/Users\/pair\/.boot\/cache\/tmp\/Users\/pair\/ap\/fe\/163d\/qcfgqv\/index.html.out\/admin\/core.js",
    "sources": [
        "index.html.out\/admin\/core.cljs"
    ],
    "lineCount": 47,
    "mappings": ";AAAA;;;;;;;;;;;AAcA;;;kBAAA,lBAASI;...",
    "names": [
        "args__10705__auto__",
        "vec__20835",
        "hoplon.core\/parse-args",
        "cljs.core\/nth",
        "admin.core\/view",
        "_",
        "hoplon.material\/view-title",
        "hoplon.ui\/elem",
        "cljs.core\/reset!",
        "app.route\/cell"
    ]
}

onetom01:09:26

now i dont know a lot about source maps, but i guess the sources should be either 1. "\/index.html.out\/admin\/core.cljs" (starting with a slash) 2. "core.cljs" (relative to the compiled file)

jjttjj02:09:42

@flyboarder I got the auth stuff working earlier without a hitch. thanks for the adding the docs!

micha02:09:02

@onetom there are no other cljs compiler options in effect?

micha02:09:09

the source maps should be a relative path, i believe

onetom03:09:40

@micha

cljs {:optimizations    :none
          :source-map       true
          :compiler-options {:parallel-build       true
                             :verbose              false
                             :cache-analysis       true
                             :recompile-dependents true}}

onetom03:09:42

these are my options. if i comment them out i would actually get "sources":["core.cljs"] BUT i still see the old location in the browser even after cmd-shift-r in chrome, which should be a force reload... 😕

onetom04:09:12

trying it with the "Disable cache (while DevTools is open)" option now

onetom04:09:00

okay, now it works, IF i comment out the :source-map true option... it sounds like a bug in boot-cljs then

onetom04:09:41

i see there is a :source-map-path option too which is set even if :optimizations is :none https://github.com/adzerk-oss/boot-cljs/blob/master/src/adzerk/boot_cljs/middleware.clj#L113-L116

onetom04:09:00

i guess it should be not set if :optimization is :none

micha14:09:39

@onetom boot-cljs should be handling that

micha14:09:02

it needs to do it even for :optimizations :none, but with different rules

micha14:09:19

that's one of the places where lots of configuration parameters are tightly coupled

micha14:09:43

you don't want to be messing with those compiler options separately because it affects other options

onetom15:09:56

yup, i read the docs and the cljs.closure/build source too

onetom15:09:24

but not specifying :source-map true works and specifying it doesn't

onetom15:09:02

so for now i just left it out of my cljs task-options!