按照https://script.clojure.org/guides/code-splitting(并添加一个deps.edn文件以依赖cljs)的指南进行,在单击加载:bar模块的按钮时得到了这个错误。
uncaught exception: AssertionError: Failure: expected object of type TrustedResourceUrl, got '/out/goog/base.js' of type string asserts.js:94:3
DEFAULT_ERROR_HANDLER https://127.0.0.1:9000/out/goog/asserts/asserts.js:94
fail https://127.0.0.1:9000/out/goog/asserts/asserts.js:245
unwrapTrustedScriptURL https://127.0.0.1:9000/out/goog/html/trustedresourceurl.js:228
unwrap https://127.0.0.1:9000/out/goog/html/trustedresourceurl.js:196
map self-hosted:251
map https://127.0.0.1:9000/out/goog/array/array.js:288
LoadStatus https://127.0.0.1:9000/out/goog/module/moduleloader.js:271
createForIds_ https://127.0.0.1:9000/out/goog/module/moduleloader.js:286
loadModules https://127.0.0.1:9000/out/goog/module/moduleloader.js:72
bind_applyFunctionN self-hosted:1059
<anonymous> self-hosted:1017
loadModules_ https://127.0.0.1:9000/out/goog/module/modulemanager.js:249
loadModulesOrEnqueue_ https://127.0.0.1:9000/out/goog/module/modulemanager.js:213
execOnLoad https://127.0.0.1:9000/out/goog/module/modulemanager.js:381
cljs$core$IFn$_invoke$arity$2 https://127.0.0.1:9000/out/cljs/loader.js:102
cljs$loader$load https://127.0.0.1:9000/out/cljs/loader.js:81
<anonymous> https://127.0.0.1:9000/out/foo/core.js:11
fireListener https://127.0.0.1:9000/out/goog/events/events.js:753
handleBrowserEvent_ https://127.0.0.1:9000/out/goog/events/events.js:879
f https://127.0.0.1:9000/out/goog/events/events.js:296
在我搜索中看到有人对ModuleManager (CLJS-3224) 进行了更改,以便调用setModuleTrustedUris,但是没有对编译器提供的module-uris从普通字符串转换为所需的TrustedResourceUrl对象进行处理。