Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find variable require #158

Open
karneaud opened this issue Jul 19, 2016 · 2 comments
Open

Could not find variable require #158

karneaud opened this issue Jul 19, 2016 · 2 comments

Comments

@karneaud
Copy link

karneaud commented Jul 19, 2016

New to clojure and clojure script but I am using your framework for unit testing in clojurescript

i have the following in my project file

:cljsbuild {
    :builds [{
      :id "dev"
      :source-paths ["src/cljs"]
      :compiler {
             :main scripts.core
             :output-to "build/js/main.js"
             :output-dir "build/js/out"
             :optimizations :none
             :source-map true
             :source-map-timestamp true
             :recompile-dependents false
             :notify-commands ["bin/phantomjs"  "bin/speclj.js" "build/js/main.js"]
           }

      },
      {
        :id "prod"
        :source-paths ["src/cljs"]
        :compiler {
               :main scripts.core,
               :output-to "build/js/main.js",
               :output-dir "build/js/output"
               :optimizations :simple,
               :source-map "build/js/main.js.map",
               :asset-path "js/out"
               :pretty-print true
             }
        }

      ]
    :test-commands {"test" ["bin/phantomjs"  "bin/speclj.js" "build/js/main.js"]}
  }
  :profiles {:dev {:plugins [[lein-pdo "0.1.1"][lein-ring "0.8.10"][lein-cljsbuild "1.1.3"]]}
             :test {
                :test-paths ["spec/cljs"]
                :source-paths ["src/cljs"]
                :dependencies [
                  [midje "1.7.0"]
                  [speclj "3.3.2"]
                  [clj-webdriver/clj-webdriver "0.6.0"]
                  [com.github.detro.ghostdriver/phantomjsdriver "1.0.3"]
                  ]
                  :plugins [[lein-midje "3.1.3"]]}}

and the following directory structure on a vagrant ubuntu-64 virtualbox

|-/bin
|--phantomjs
|--speclj.js
|-/src
|--/cljs
|---/scripts
|--core.cljs
|-/spec
|--/cljs
|---/scripts
|--core_spec.cljs

when I run
lein with-profile test cljsbuild test test

I get

Fontconfig warning: ignoring UTF-8: not a valid region tag
ReferenceError: Can't find variable: require
bin/speclj.js:3 in global code
:0 in injectJs
ReferenceError: Can't find variable: speclj
phantomjs://webpage.evaluate():2
phantomjs://webpage.evaluate():6

What is the error about?

@karneaud
Copy link
Author

added a new build config

{

          :id "test"
          :source-paths ["src/cljs" "spec/cljs"]
          :compiler {
                  :main scripts.core
                  :output-to "resources/public/js/main.js"
                  :output-dir "resources/public/js/out"
                  :optimizations :none
                  :pretty-print true
                  :target :nodejs
                  :notify-commands ["bin/phantomjs"  "bin/speclj.js" "build/js/main.js"]
                  }
        }

Same error

@Luke1298
Copy link

Luke1298 commented Oct 4, 2019

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants