【发布时间】:2016-10-14 19:53:39
【问题描述】:
我有一个非常简单的项目。我用 boot 和 cljs 创建了有史以来最简单的项目。它编译成功,我能够在 html 中看到正确的日志。当我添加对异步的基本支持时,我收到了消息:
No such namespace: clojure.core.async, could not locate clojure/core/async.cljs, clojure/core/async.cljc, or Closure namespace "clojure.core.async"
该项目只有以下结构:
exemplo_cljs
html
index.html
src
exemplo_cljs
core.cljs
build.boot
index.html的内容:
<!doctype html>
<html lang="en">
<head>
<title>Hello</title>
</head>
<body>
<h2>Hello</h2>
<script src="main.js"></script>
</body>
</html>
core.cljs
(ns exemplo-cljs.core
(:require [clojure.core.async :as async]))
(def exercise (async/chan))
;; enable cljs to print to the JS console of the browser
(enable-console-print!)
;; print to the console
(println "Hello, World 4!")
和 build.boot
(set-env!
:source-paths #{"src"}
:resource-paths #{"html"}
:dependencies '[[adzerk/boot-cljs "1.7.170-3"]
[org.clojure/core.async "0.2.371"]])
(require '[adzerk.boot-cljs :refer [cljs]])
除了 core.cljs 文件中通道的 require 和 def 以及 build.boot 中添加的依赖项之外,原始工作项目具有相同的基本结构
【问题讨论】:
标签: clojure clojurescript core.async boot-clj