Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

Following the guide at https://clojurescript.org/guides/code-splitting (and adding a deps.edn for cljs dependency) and got this error when clicking the button to load the :bar module.

uncaught exception: AssertionError: Failure: expected object of type TrustedResourceUrl, got '/out/goog/base.js' of type string asserts.js:94:3
DEFAULT_ERROR_HANDLER http://localhost:9000/out/goog/asserts/asserts.js:94
fail http://localhost:9000/out/goog/asserts/asserts.js:245
unwrapTrustedScriptURL http://localhost:9000/out/goog/html/trustedresourceurl.js:228
unwrap http://localhost:9000/out/goog/html/trustedresourceurl.js:196
map self-hosted:251
map http://localhost:9000/out/goog/array/array.js:288
LoadStatus http://localhost:9000/out/goog/module/moduleloader.js:271
createForIds_ http://localhost:9000/out/goog/module/moduleloader.js:286
loadModules http://localhost:9000/out/goog/module/moduleloader.js:72
bind_applyFunctionN self-hosted:1059
<anonymous> self-hosted:1017
loadModules_ http://localhost:9000/out/goog/module/modulemanager.js:249
loadModulesOrEnqueue_ http://localhost:9000/out/goog/module/modulemanager.js:213
execOnLoad http://localhost:9000/out/goog/module/modulemanager.js:381
cljs$core$IFn$_invoke$arity$2 http://localhost:9000/out/cljs/loader.js:102
cljs$loader$load http://localhost:9000/out/cljs/loader.js:81
<anonymous> http://localhost:9000/out/foo/core.js:11
fireListener http://localhost:9000/out/goog/events/events.js:753
handleBrowserEvent_ http://localhost:9000/out/goog/events/events.js:879
f http://localhost:9000/out/goog/events/events.js:296

I saw in my searches that a change was made to call setModuleTrustedUris on the ModuleManager (CLJS-3224), but nothing was done to convert the module-uris provided by the compiler from plain strings to the required TrustedResourceUrl objects.

1 Answer

0 votes
by
edited by
 
Best answer
...