How to resolve Uncaught TypeError: clojure is undefined

How to resolve Uncaught TypeError: clojure is undefined

我对我的 clojurescript 项目做了一些事情导致了这个错误,我正在使用 figwheel-main 和 deps.edn,不太确定要寻找什么来解决这个问题,听起来好像没有找到 clojurescript 本身当 运行 在浏览器中

Uncaught TypeError: clojure is undefined
    option_values_fmt http://localhost:9500/cljs-out/main.js:3842
    cljs$core$IReduce$_reduce$arity http://localhost:9500/cljs-out/main.js:2534
    cljs$core$IFn$_invoke$arity http://localhost:9500/cljs-out/main.js:1626
    reduce http://localhost:9500/cljs-out/main.js:1623
    option_values_fmt http://localhost:9500/cljs-out/main.js:3842
    <anonymous> http://localhost:9500/cljs-out/main.js:3850

我的 figwheel 文件看起来像这样,我所做的更改之一是将很多要求放在 :extra-deps 而不是 :deps 下 clojurescript 和 clojure 仍然包含在根目录中。

{:output-to "resources/public/cljs-out/main.js"
 :optimizations :none
 ;:pseudo-names true
 :pretty-print true
 :source-map true
 :source-map-timestamp true
 :devcards true
 :main webpage.core}

我应该寻找什么可能导致此错误?

这很可能是您代码中某处的问题,而不是您的依赖项。

例如,如果您使用完全限定的引用(例如 (clojure.string/anything ...))而没有事先正确要求引用的命名空间(即 (:require [clojure.string ...]) 在您的 ns 表单中,就会发生这种情况). require 确保代码在您的代码执行之前实际加载并可用。