Skip to content

[cljs.repl.browser/repl-env] index.html must use out/main.js? #47

@WillForan

Description

@WillForan

Not an issue. Just something that took me long enough to realize that I thought it worth writing down. When there's no index.html in ./ or out/, the repl index template cljs.repl.browser/default-index is used and tests run. But when an index is within the :static-dir vector (?), I was catching

Kaocha ClojureScript client failed connecting back.

Adding <script src="out/main.js"> </script> in the body of index.html resolved this! The browser can't talk back to kaocha without loading the instructions to do so -- painfully obvious now, not so much an hour ago.

I'm not yet familiar enough with all the repl options to come up with other solutions. It's fine for me to have a 404 script in at the bottom of index.html for all but tests. But still, I though I could make a testing specific index page (e.g. test/index.html) with something like :repl-opts {:static-dir ["test/" "." "out/"]} in test.edn. But I haven't gotten that to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationAn issue or improvement related to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Candidate

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions