Code Monkey home page Code Monkey logo

Comments (4)

danielcompton avatar danielcompton commented on June 26, 2024

What is the original issue/commit that fixed this? Also, is this a lein-cljsbuild specific issue? Lastly, can you restate the actual issue you're having here? It's not completely clear from your description above what is going wrong (including error messages is helpful).

from lein-cljsbuild.

JoshuaXX avatar JoshuaXX commented on June 26, 2024

yes. it is lein-cljsbuild specific.

I issued the command "lein cljsbuild once dev" to build all file under src/cljs directory and src/cljc directory.

Error Message:
Reloading Clojure file "atpco.record.rule.intlfare" failed.
clojure.lang.Compiler$CompilerException: java.lang.ExceptionInInitializerError, compiling:(atpco/record/intlfare.cljc:1:1)
Compiler.java:7526 clojure.lang.Compiler.load
RT.java:379 clojure.lang.RT.loadResourceScript
RT.java:370 clojure.lang.RT.loadResourceScript
RT.java:460 clojure.lang.RT.load
RT.java:426 clojure.lang.RT.load
core.clj:6046 clojure.core/load[fn]
core.clj:6045 clojure.core/load
core.clj:6029 clojure.core/load
RestFn.java:408 clojure.lang.RestFn.invoke
core.clj:5848 clojure.core/load-one
core.clj:5843 clojure.core/load-one
core.clj:5888 clojure.core/load-lib[fn]
core.clj:5887 clojure.core/load-lib
core.clj:5868 clojure.core/load-lib
RestFn.java:142 clojure.lang.RestFn.applyTo
core.clj:659 clojure.core/apply
core.clj:5925 clojure.core/load-libs
core.clj:5909 clojure.core/load-libs
RestFn.java:137 clojure.lang.RestFn.applyTo
core.clj:659 clojure.core/apply
core.clj:5947 clojure.core/require
.....

I think this issue is similar with #210.

During the build process, some clojure code is loading which cause this error message.

It seems to me the error is due to this reason:
even if I used reader conditional like
(ns atpco.record.intlfare
#?(:cljs (:require-macros [farefront.tools.core :as tools ]))
#?(:clj (:require [farecommon.tools.core :as tools])))
in .cljc file, the cljsbuild always trying to read farecommon.tools.core namespace, which is clojure code.
lein-cljsbuild should not trying to read that namespace. It only should read farefront.tools.core namespace.

Best regards

from lein-cljsbuild.

mneise avatar mneise commented on June 26, 2024

@JoshuaXX Would you mind setting up a minimal repo where this issue can be reproduced?

from lein-cljsbuild.

mtruyens avatar mtruyens commented on June 26, 2024

Hi,

I just rain into this issue myself. Please find attached a minimal test case (created using lein new luminus myapp +cljs).

Essentially, it just:

  • created a CLJ file (dummy.clj) with a single function (dummy)
  • tried to require this CLJ file from within a CLJC file (validation.cljc) using
(ns myapp.validation
  (:require [struct.core :as st]
            #?(:clj [myapp.dummy :as dummy])))

When invoking lein cljsbuild once the error message is as fllows:

Compiling ["target/cljsbuild/public/js/app.js"] from ["src/cljs" "src/cljc" "env/dev/cljs"]...
WARNING: No such namespace: dummy, could not locate dummy.cljs, dummy.cljc, or JavaScript source providing "dummy" at line 7 src/cljc/myapp/validation.cljc
WARNING: Use of undeclared Var dummy/dummy-fn at line 7 src/cljc/myapp/validation.cljc

Everything eventually builds fine, however.
myapp.zip

from lein-cljsbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.