Fork me on GitHub
#shadow-cljs
<
2019-04-29
>
stefan18:04:53

I believe I’ve followed the steps in the Quick Start section and everything looks to be working with the exception of nothing showing in the browser’s console log

stefan18:04:21

this is my init function

hoopes19:04:38

like right above the println

stefan19:04:40

I get this error when I add that function Use of undeclared Var garray/clone

stefan19:04:04

doesn’t specify the need to set anything up regarding logging though

talgiat19:04:12

We’re having issues with upgrading to re-frame-10x latest version (0.4.0). When running the dev builds npm install is ran trying to install the specific versions in deps.cljs of re-frame-10x. I didn’t find an options to turn that off. I saw this issue on re-frame-10x https://github.com/Day8/re-frame-10x/issues/188 but not sure what’s the exact status.

thheller20:04:25

@talgiat the install logic should only trigger if the dependency is not already in package.json?

thheller20:04:49

so if you have react in your package.json already it should not attempt to install react from deps.cljs?

talgiat20:04:55

yeah we have react in the deps

talgiat20:04:26

still tries to install

talgiat20:04:04

we do import the dependancies from leiningen

stefan20:04:24

so on save this code recompiles, and I see the shadow-cljs icon in the bottom left of the browser…but the page does not reload

stefan20:04:32

If I reload manually I see my changes

thheller20:04:12

@talgiat it still triggers the install of the older version? it really shouldn't?

thheller20:04:09

@stefan.age you need to define an :dev/after-load hook that will re-render your page https://shadow-cljs.github.io/docs/UsersGuide.html#_lifecycle_hooks

thheller20:04:19

eg. (defn ^:dev/after-load init [] ...)

thheller20:04:17

@talgiat it doesn't for me. do you have any weird path setups? eg. package.json not in the same directory as shadow-cljs.edn?

stefan20:04:25

oh beautiful, thanks @thheller

thheller20:04:57

so the problem is that is installs an older version of react over the one you have already installed?

talgiat20:04:37

I have package-lock as well

thheller20:04:43

so I just created a dummy new project, npm install react react-dom create-react-class manually to get latest version

thheller20:04:04

then added re-frame-10x dep and started shadow-cljs

thheller20:04:07

shadow-cljs - dependencies updated
NPM dependency "react" has installed version "^16.8.6"
"16.3.0" was required by jar:file:/home/thheller/.m2/repository/day8/re-frame/re-frame-10x/0.4.0/re-frame-10x-0.4.0.jar!/deps.cljs
NPM dependency "react-dom" has installed version "^16.8.6"
"16.3.0" was required by jar:file:/home/thheller/.m2/repository/day8/re-frame/re-frame-10x/0.4.0/re-frame-10x-0.4.0.jar!/deps.cljs
NPM dependency "create-react-class" has installed version "^15.6.3"
"15.6.2" was required by jar:file:/home/thheller/.m2/repository/day8/re-frame/re-frame-10x/0.4.0/re-frame-10x-0.4.0.jar!/deps.cljs
running: npm install --save [email protected] [email protected] [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
added 3 packages from 247 contributors and audited 693 packages in 2.771s
found 0 vulnerabilities

thheller20:04:15

as expected it only installs what it should?

thheller20:04:49

{
  "name": "deps-cljs-test",
  "version": "0.0.1",
  "private": true,
  "devDependencies": {
    "shadow-cljs": "2.8.35"
  },
  "dependencies": {
    "create-react-class": "^15.6.3",
    "highlight.js": "^9.12.0",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-flip-move": "^3.0.1",
    "react-highlight.js": "^1.0.7"
  }
}

thheller20:04:10

after the install

thheller20:04:31

the next start still complains about the version conflicts but besides that everything is fine and no install is triggered?

thheller20:04:45

$ shadow-cljs server
shadow-cljs - config: /mnt/c/Users/thheller/tmp/deps-cljs-test/shadow-cljs.edn  cli version: 2.8.35  node: v10.13.0
NPM dependency "react" has installed version "^16.8.6"
"16.3.0" was required by jar:file:/home/thheller/.m2/repository/day8/re-frame/re-frame-10x/0.4.0/re-frame-10x-0.4.0.jar!/deps.cljs
NPM dependency "react-dom" has installed version "^16.8.6"
"16.3.0" was required by jar:file:/home/thheller/.m2/repository/day8/re-frame/re-frame-10x/0.4.0/re-frame-10x-0.4.0.jar!/deps.cljs
NPM dependency "create-react-class" has installed version "^15.6.3"
"15.6.2" was required by jar:file:/home/thheller/.m2/repository/day8/re-frame/re-frame-10x/0.4.0/re-frame-10x-0.4.0.jar!/deps.cljs
[2019-04-29 20:50:58.607 - WARNING] TCP Port 9630 in use.
[2019-04-29 20:50:58.612 - WARNING] TCP Port 9631 in use.
[2019-04-29 20:50:58.617 - WARNING] TCP Port 9632 in use.
shadow-cljs - server version: 2.8.35 running at 
shadow-cljs - nREPL server started on port 57985