We're updating the issue view to help you get more done. 

Undefined nameToPath for bootstrap` when using Twitter's Bootstrap (twbs)

Description

How to reproduce problem

src/cljsbuild_bootstrap4/core.cljs

1 2 3 4 5 6 7 8 (ns cljsbuild-bootstrap4.core (:require [bootstrap])) (enable-console-print!) (println "Hello world!") (-> ".alert" js/jQuery (.alert "close"))

index.html

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>cljsbuild-bootstrap4</title> <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css"/> </head> <body> <div class="alert alert-warning alert-dismissible fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <strong>Holy guacamole!</strong> I should be fading. </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="out/main.js"></script> </body> </html>

build.clj

1 2 3 4 5 6 (require 'cljs.build.api) (cljs.build.api/build "src" {:output-to "out/main.js" :main 'cljsbuild-bootstrap4.core :install-deps true :npm-deps {:bootstrap "4.0.0-beta"}})
  1. Copy the 1.9.946 cljs.jar to the current working directory

  2. Run

    1 java -cp cljs.jar:src clojure.main build.clj
  3. open index.html

  4. Observe console messages.

Expected result

  1. Console should show the following messages:

    1 2 Error: Bootstrap dropdown require Popper.js (https://popper.js.org) Hello world!
  2. The Bootstrap Alert component should fade from the page resulting in a blank page.

  3. Compiler should produce:

    out/cljs_deps.js

    1 2 3 4 5 goog.addDependency("base.js", ['goog'], []); goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.object', 'goog.math.Integer', 'goog.string.StringBuffer', 'goog.array', 'goog.math.Long']); goog.addDependency("../process/env.js", ['process.env'], ['cljs.core']); goog.addDependency("../node_modules/bootstrap/dist/js/bootstrap.js", ['bootstrap'], []); goog.addDependency("../cljsbuild_bootstrap4/core.js", ['cljsbuild_bootstrap4.core'], ['cljs.core', 'bootstrap']);

Actual result

  1. Console shows

    1 Error: Undefined nameToPath for bootstrap
  2. The Bootstrap Alert component fails to fade from the page and remains on the page.

  3. Compiler produces:

    out/cljs_deps.js

    1 2 3 4 goog.addDependency("base.js", ['goog'], []); goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.object', 'goog.math.Integer', 'goog.string.StringBuffer', 'goog.array', 'goog.math.Long']); goog.addDependency("../process/env.js", ['process.env'], ['cljs.core']); goog.addDependency("../cljsbuild_bootstrap4/core.js", ['cljsbuild_bootstrap4.core'], ['cljs.core', 'bootstrap']);

Environment

1.9.946

Status

Assignee

Mike Fikes

Reporter

Corin Lawson

Labels

Approval

None

Patch

None

Priority

Minor