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

Compile Exception: No such namespace: react #3

Open
stardiviner opened this issue Dec 8, 2019 · 5 comments
Open

Compile Exception: No such namespace: react #3

stardiviner opened this issue Dec 8, 2019 · 5 comments

Comments

@stardiviner
Copy link

After clj -A:dev
I got error:

2019-12-08 11:21:50.745:INFO::main: Logging initialized @21779ms to org.eclipse.jetty.util.log.StdErrLog
[Figwheel] Compiling build dev to "bin/main.js"
[Figwheel] Successfully compiled build dev to "bin/main.js" in 2.424 seconds.
[Figwheel] Outputting main file: bin/renderer.js
[Figwheel] Outputting main file: bin/tests.js
[Figwheel] Watching paths: ("src/config/dev" "src/main" "src/renderer" "src/test") to compile build - dev
[Figwheel] Starting Server at http://localhost:9500
[Figwheel] Starting REPL
Prompt will show when REPL connects to evaluation environment (i.e. Node)
Figwheel Main Controls:
          (figwheel.main/stop-builds id ...)  ;; stops Figwheel autobuilder for ids
          (figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
          (figwheel.main/reset)               ;; stops, cleans, reloads config, and starts autobuilder
          (figwheel.main/build-once id ...)   ;; builds source one time
          (figwheel.main/clean id ...)        ;; deletes compiled cljs target files
          (figwheel.main/status)              ;; displays current state of system
Figwheel REPL Controls:
          (figwheel.repl/conns)               ;; displays the current connections
          (figwheel.repl/focus session-name)  ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
    Docs: (doc function-name-here)
    Exit: :cljs/quit
 Results: Stored in vars *1, *2, *3, *e holds last exception object
[Rebel readline] Type :repl/help for online help info
Launching Javascript environment with script:  ["npm" "start"]
Environment output being logged to: cljs-temp/js-environment.log
Compile Exception: No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react" in file file:/home/stardiviner/.m2/repository/reagent/reagent/0.9.0-rc3/reagent-0.9.0-rc3.jar!/reagent/core.cljs 
ClojureScript 1.10.597
cljs.user=>

I checked out file cljs-temp/js-environment.log.

[282758:1208/112222.978941:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[282758:1208/112223.038066:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
ld=dev&fwsid=639d3694-2205-402e-a892-719d7ebebe63
 [Figwheel REPL] Session ID: 639d3694-2205-402e-a892-719d7ebebe63
 [Figwheel REPL] Session Name: Monroe

I checked out the error source file reagent/core.cljs. I found react dependency in POM file. Then I try to install it manually.

I try to install react with command clj -Sdeps '{:deps {cljsjs/react {:mvn/version "16.9.0-0"}}}' successfully.

Then I restart clj -A:dev. Still raise up this error.

@stardiviner
Copy link
Author

Problem solved, I manually added react and react-dom dependencies into deps.edn fixed this error. Hope this can be added to electron-app template in future.

@stardiviner
Copy link
Author

Now the deps.edn is:

:deps    {org.clojure/clojure             {:mvn/version "1.10.1"}
           org.clojure/clojurescript       {:mvn/version "1.10.597"}
           com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
           com.bhauman/figwheel-main       {:mvn/version "0.2.3"}
           reagent                         {:mvn/version "0.9.0-rc3" :exclusions [cljsjs/react cljsjs/react-dom]}
           cljsjs/react                    {:mvn/version "16.11.0-0"}
           cljsjs/react-dom                {:mvn/version "16.11.0-0"}}

@paulbutcher
Copy link
Owner

You really should not need to do this - react and react-dom are both installed as Node dependencies (see https://github.com/paulbutcher/electron-app/blob/master/resources/clj/new/electron_app/package.json#L15)

Are you quite sure that you've run npm install as described in the README?

@paulbutcher
Copy link
Owner

paulbutcher commented Dec 8, 2019

I am concerned that the issues that you describe in #2 suggest that there is something odd about your configuration of npm. Are react and react-dom in node_modules? If not, this is your problem and the solution is to fix whatever's wrong with npm on your system.

@stardiviner
Copy link
Author

I only have this config in ~/.npmrc

editor=emacsclient
registry=https://registry.npm.taobao.org
disturl=https://npm.taobao.org/mirrors/node
ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron

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