Undefined nameToPath for bootstrap` when using Twitter's Bootstrap (twbs)
Description
Environment
1.9.946
Activity

Mike FikesMay 19, 2018 at 10:22 PM
Ahh I see what is going on. This is a problem with 1.9.946. No longer reproducible with 1.10.238.

Mike FikesMay 19, 2018 at 10:08 PM
Corin, I can't repro. I've also updated the description so that anyone can attempt to repro. (Minimal per https://clojurescript.org/community/reporting-issues)
I get a slightly different out/cljs_deps.js
(below), but otherwise, I get the expected behavior as per the ticket description.
out/cljs_deps.js

importJanuary 8, 2018 at 8:03 AM
Comment made by: derekchiang
Getting the same error for `ethereumjs-abi` too.
Log from console:
```
base.js:1357 Uncaught Error: Undefined nameToPath for ethereumjs_abi
at visitNode (base.js:1357)
at visitNode (base.js:1355)
at visitNode (base.js:1355)
at Object.goog.writeScripts_ (base.js:1369)
at Object.goog.require (base.js:706)
at (index):46
```

poernahiSeptember 29, 2017 at 9:31 AM
I am also getting the same error when trying to use 'apollo-client'. 'cljs_deps.js' would be missing the 'whatwg-fetch' dependency.
I suspect this is because 'whatwg-fetch' is a polyfill that does not explicitly export anything. I was able to workaround the issue by appending the following lines to the bottom of '<projectdir>/node_modules/whatwg-fetch/fetch.js'
const whatwg_fetch = 1;
export { whatwg_fetch };
I don't know enough to say that this is the same problem, other than the error message being identical. I have not tried adding the same hack to bootstrap.js

poernahiSeptember 29, 2017 at 1:44 AM
I came across the same problem and did some tracing. It looks like 'load-foreign-library' correctly populated the 'provides' key, but 'library-graph-node' failed to get the 'provides'. I also observed that the output of library-graph-node is the one that gets passed to cljs_deps.js
load-foreign-library: /Users/Hendrik/Projects/bugreports/cljsbuild-bootstrap4/node_modules/bootstrap/dist/js/bootstrap.js
provides: ["bootstrap" "bootstrap/dist/js/bootstrap.js" "bootstrap/dist/js/bootstrap"]
load-foreign-library: /Users/Hendrik/Projects/bugreports/cljsbuild-bootstrap4/node_modules/bootstrap/package.json
provides: []
Copying file:/Users/Hendrik/Projects/bugreports/cljsbuild-bootstrap4/node_modules/bootstrap/dist/js/bootstrap.js to out/node_modules/bootstrap/dist/js/bootstrap.js
load-library: out/node_modules/bootstrap/dist/js/bootstrap.js
library-graph-node: /Users/Hendrik/Projects/bugreports/cljsbuild-bootstrap4/out/node_modules/bootstrap/dist/js/bootstrap.js
{:requires [], rovides [],
:url #object[java.net.URL 0x6a0659ac "file:/<snip>/cljsbuild-bootstrap4/out/node_modules/bootstrap/dist/js/bootstrap.js"],
:closure-lib true, :lib-path "out/node_modules/bootstrap/dist/js/bootstrap.js"}
How to reproduce problem
src/cljsbuild_bootstrap4/core.cljs
index.html
build.clj
Copy the 1.9.946
cljs.jar
to the current working directoryRun
open
index.html
Observe console messages.
Expected result
Console should show the following messages:
The Bootstrap Alert component should fade from the page resulting in a blank page.
Compiler should produce:
out/cljs_deps.js
Actual result
Console shows
The Bootstrap Alert component fails to fade from the page and remains on the page.
Compiler produces:
out/cljs_deps.js