This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-18
Channels
- # beginners (56)
- # boot (1)
- # cider (96)
- # cljs-dev (148)
- # clojure (60)
- # clojure-austin (11)
- # clojure-france (2)
- # clojure-italy (5)
- # clojure-russia (11)
- # clojure-spec (31)
- # clojure-uk (5)
- # clojurescript (52)
- # community-development (37)
- # cursive (3)
- # data-science (8)
- # datomic (14)
- # devcards (2)
- # emacs (1)
- # fulcro (13)
- # hoplon (1)
- # immutant (2)
- # luminus (3)
- # off-topic (2)
- # onyx (16)
- # parinfer (38)
- # re-frame (8)
- # reagent (5)
- # shadow-cljs (332)
- # spacemacs (5)
- # specter (5)
- # sql (6)
- # vim (52)
I'm trying to use shadow with deps.edn
, but I'm getting this:
Wilker-Nu:pathom-book wilkerlucio$ shadow-cljs watch book
shadow-cljs - config: /Users/wilkerlucio/Development/pathom-book/shadow-cljs.edn version: 2.1.16
shadow-cljs - starting via "clojure"
Invalid option: -Sdeps
ideas what's that about?
I'm getting it should be trying to call -Spath
instead?
I've been spending a lot of time tonigh trying to find out why shadow-cljs release compiles differently on my computer vs on server. I'm useing same node and shadow-cljs versions, its the same git repo. I don't know what I could be missing, what could cause this. Because the error I get from the server I don't get on my computer, and if I copy the server compilation on to my computer, then I get the same error.
oh I think I see it now, on my computer I has shadow-cljs 2.1.6 the server has 2.1.16, guess my eyes got fooled, going to check that..
yup confirmed, there's clearly an error that is present in 2.1.16 that is not present in 2.1.6, and reading the error it doesn't look like my code is anywhere there in between
TypeError: Cannot call a class as a function
at b.a (quill.js:1952)
at new b (quill.js:5471)
at b.value (quill.js:5367)
at b.value (quill.js:6617)
at new a (quill.js:1111)
at a.createEditor (mixin.js:13)
at a.componentDidMount (component.js:202)
at a.componentDidMount (factory.js:666)
at commitLifeCycles (react-dom.production.min.js:150)
at c (react-dom.production.min.js:159)
this does not have to be because of shadow-cljs.. going to investiage@wilkerlucio -Sdeps
should be available. maybe you have an older version where its not?
@thheller yes, I gave up. It was successfully compileing, then I updated shadow, it failed, so I wanted to go back to version 2.1.6 and the failure stayed, maybe cacheing, target unclean. Don't know, but I'm ditching react-quill, useing quill straight up.
@thheller on the spot, updated clj and it's working fine 🙂
maybe, as for every module require I was doing Module/default (which after reading the docs better, is avoidable), except react-quill... ok, going to have one more look at the chilren of the objects returned by importing react-quill...
:default
is in a weird situation in some packages because even though they might provide examples as ES6 with default imports
is it possible to activate extra deps aliases via command line?
@wilkerlucio no, only per config :deps {:aliases [:alias ...]}
extra-deps does not make sense to me in a CLJS setting. maybe you have a use-case where it make sense but so far I haven't found one
I was thinking that shadow could have something like --clj-options -A:more-alias:other
in my case is more related to extra paths
yes, maybe shadow could default to :default, probably screws up backwards compatability (and not compatable with rest of cljs I assume, so bad idea)
I imagine having deploy build with regular settings, but for dev I want to add local source paths to use dev versions
also there could be situations you want to try building against different lib versions
@hlolli :default
isn't in CLJS yet so I could definitely change it. problem is that the node/webpack world handles default exports differently than closure
I tried going the closure way but that broke way too many libs so I went with a compromise for now
@wilkerlucio ok, I'll add -A
support
nah the situation is just messy and supporting the mess that is on npm sometimes is not their goal
yes, it's very messy, all my kudos to the closure developers that are trying to make something stable
ah, ok I though google closure had some babel functionality behind the hood, since import seemed to be what was running
Im swimming in a mess, just deleted target and trying again now, then I can test this require
not 2.1.16, didnt try in between, so I dont know where it fails, well I did try, but as I was down to 2.1.10 I realized I didnt delete target in between of downgrading shadow-cljs 🙂
I had successful case of deleteing target just 5 mins ago, shadow-cljs was complaining about superfuntion or something, too strange to make sense, so it left after I tortched target.
it might work if you add [com.google.javascript/closure-compiler-unshaded "v20180101"]
to your deps
oh wait I just tested with [com.google.javascript/closure-compiler-unshaded "v20170910"]
. so maybe thats the safe option.
yes it works, but notice a clue here, if you do [:> Quill/Quill]
you get the same error as before.
and also printing the object Quill (the :as Quill) then the letter c #object[c], was b. If that could matter
thanks so much, here ends 11 hours struggle 😄, these kinds of issues really kill the flow and fun.
thats a good mindset, but yeh, it shows thats closure can sometime do non backwards compatable things.
maybe there's some logic to their changes, or this is a bug, it seemed to be the default export was the supposedly nested quill.js object. Could that be symbol bug, maybe we can give this a better try on the newest closure compiler.
at least the difference seems to be that what object ["react-quill" :as Quill]
becomes, differes between the compiler versions.
really... it seemes to me that the error message from the older version from [:> Quill/Quill]
and [:> Quill]
in newer compiler is exacly the same, but I can look better..
my theory goes like that, that in newest closure version ["react-quill" :as Quill]
is also not the component
https://github.com/google/closure-compiler/commit/6b807c063d42a463e3c32e5911c695a0976e2b67
@wilkerlucio -A:foo
now supported in 2.1.17
@thheller after I updated to 2.1.17
, trying to compile is generating a lot of those:
------ WARNING #1 --------------------------------------------------------------
File: /Users/wilkerlucio/Development/third-part/fulcro/src/main/fulcro/client/primitives.cljc:608:21
--------------------------------------------------------------------------------
605 | (if-not (nil? x)
606 | #?(:clj (or (instance? fulcro.client.impl.protocols.IReactComponent x)
607 | (satisfies? p/IReactComponent x))
608 | :cljs (true? (. x -fulcro$isComponent)))
---------------------------^----------------------------------------------------
Cannot infer target type in expression (. x -fulcro$isComponent)
--------------------------------------------------------------------------------
609 | false))
610 |
611 | #?(:clj
612 | (defn react-type
they are too many (140 in my case) the warns are poluting the UI on browser, making unusable =/
how I disable that?
true
was the previous default? what is the default now?
most of then seem to come related to fulcro code
it will warn about all native interop where the interop value cannot be identified as js or clj
agreed, I just got back to sanity with the compiler option set to true again
humm, that makes sense, I'm using a bunch of things in dev mode at this point
not sure if @tony.kay is aware about those at this point
trouble is that those probably don't require externs but the compiler can't figure this out on its own
33 | (.on socket "message" on-message!)
----------------^---------------------------------------------------------------
Cannot infer target type in expression (. socket on "message" on-message!)
but if you didn't have issues so far you can probably either upgrade or disable via config
again I'm getting strange difference between server and my computer, same shadow-cljs and same closure versions, which I find hard to believe. It's the tab button from material-ui menu, when I click on it, the server greets me with
index.js:19 Uncaught TypeError: Cannot read property 'ease' of undefined
at Object.left (index.js:19)
at b.d.scrollSelectedIntoView (Tabs.js:257)
at b.value (Tabs.js:308)
at commitLifeCycles (react-dom.production.min.js:150)
at b (react-dom.production.min.js:159)
at ka (react-dom.production.min.js:170)
at t (react-dom.production.min.js:169)
at p (react-dom.production.min.js:168)
at m (react-dom.production.min.js:166)
at Object.enqueueForceUpdate (react-dom.production.min.js:110)
and crashes the root component and leaves the site with only background, typical react crash, investiageing...@hlolli is it possible that the server includes some other javascript that might cause conflicts?
I've torched the js dir, no its still at this point completly the same, same server handler etc.
I'm starting to suspect some callback stuff, its way slower connection, the server is in iceland and im in germany
ok I guess the md5sum differ, Im getting lost in all those terminal windows of on which computer I am
I wouldn't count on it. should rather try shadow-cljs release app --debug
to get more clues about where you are at in the code
Uncaught TypeError: Cannot read property 'ease' of undefined
since its named ease
I don't think its an externs issue
ok, I need coffee, it says on my computer
✗ shadow-cljs release public --debug
shadow-cljs - config: /home/hlolli/Documents/visitor/shadow-cljs.edn version: 2.1.16
...
[:public] Build completed. (1509 files, 1389 compiled, 0 warnings, 48.10s)
oh damn, tmux is not allowing me to select text and copy,but on the server it's 1476 files, should be easy to track, I should have seen this earleir
🎉sanity! Yarn compiled the exact same amount of files and now I get the bug on my laptop, the same as on the server.
hehe yeh, I wonder if I was cacheing older react versions, going to give some downgrade a try
it seems to be bad codeing that this closure only receives 2 arguments out of 4 on call
_scroll2.default.left(_this.tabs, invert * nextScrollLeft);
module.exports = {
left: make('scrollLeft'),
top: make('scrollTop')
}
function make (prop) {
return function scroll (el, to, opts, cb) {
if (typeof opts == 'function') cb = opts, opts = {}
var ease = opts.ease || inOutSine
but the object opts gets set to a default value {}, would guess that just adding var
in front of that could fix is. In any case I open an issue.the latest closure v20180204
didnt fix this, Im surprised how this worked for so long in the first place, only god knows (ergo nobody). But the idea of overriding I'll do anyway
just tried to make a release build, but on some cases I'm getting this weird error:
TypeError: Cannot read property 'log' of null
at b (main.js:1638)
@thheller should I use :npm or will :file work too
:js-options {:resolve {"scroll" {:target :file
:require "./overrides/scroll_index.js"}}}
@wilkerlucio shadow-cljs release app --debug
should make it easier to find whats null
thanks, trying
other thing that worth mention, when I delete the target
and try to run shadow commands, I get this:
shadow-cljs - error ENOENT: no such file or directory, open 'target/shadow-cljs/logging.properties'
then I have to manually create the target/shadow-cljs
back so it works
if I delete the target
folder
rm -rf target
any of then it seems, but I've been trying with watch
about the --debug, seems something related to logging
on fulcro, that uses some logging stuff from closure
yeah, :deps
is been used
fixed the release build, had to add :compiler-options {:closure-defines {goog.LOCALE "en"}}
, I remembered reading this earlier here
didnt go trough
this is still in the manifest and output "node_modules/scroll/index.js"
after
:js-options {:resolve {"scroll" {:file "overrides/scroll_index.js"}}}
yes, you could theoretically get all that data just from :require vs :file ? no pain to add target whatsoever
now I have these two files nested in release ... target dir
module$overrides$scroll_index.js
module$node_modules$scroll$index.js
and the code requireing scroll/index.js finds neither. Maybe harmless, just wondering if this is affecting the correct true state of the target to compilation.you can check the modules$node_modules$material_ui$tabs$tabs.js
or whatever that was called
var _scroll = require('scroll');
var _scroll2 = _interopRequireDefault(_scroll);
function called from _scroll2 that existed, is now not found@thheller not sure what you mean by goog.LOCALE "en"
is one of the defaults, defaults of what?
@wilkerlucio https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/build/api.clj#L42-L45
and its the default in closure itself, so setting it to en
shouldn't really make a difference?
well, it surely did here
was a random attempt, I just remembered you saying something about it here, I tried and worked 😛
haha no "output" to show, deleted target, compiled again and now I can scroll like a m***fa*a
this feature of patcheing/overriding the npm modules, is very very important. Going to implement this into the lumo binary bundler I made recently. Since requireing .node files needs always some patcheing, not counteing fixing bugs.
yeh, nexe has this concept of monkeypatching, I was already on the path of seeing the importance of this.
this at least time from creating a fork, and aim npm modules to a github repo, which is the classical way I guess.
yeah :resolve {"scroll" {:target :npm :require "@hlolli/scroll"}}
would have been the alternative
no Im blameing the wrong victim here, this code is fine, mostly, just Tabs.js that was not filling in all the parameters
still need to do https://github.com/thheller/shadow-cljs/issues/173
Im glad I was able to fix it, but the cost of time chaseing these errors probably outweigh the benefit. Sounds reasonable to do this.
hmm, i’m setting up shadow-cljs in a new blank project and getting
shadow-cljs - error ENOENT: no such file or directory, open 'target/shadow-cljs/logging.properties'
did some backtracking, and looks like this happens for every version 2.0.143 to presentfixed in [email protected]
I hope
hmm,
mattpro:re-style MattPro$ npx shadow-cljs server
shadow-cljs - config: /Users/MattPro/Documents/sites2017/re-view/re-style/shadow-cljs.edn version: 2.1.20
shadow-cljs - error ENOENT: no such file or directory, open 'target/shadow-cljs/logging.properties'
I'm still seeing that too
@mhuebert as a workaround, just mkdir -p target/shadow-cljs
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/npm/cli.cljs#L618 that should take care of creating it?
weird...
@thheller I'm just starting trying to create the react native app, but got an error that I didn't see before:
[:app] Configuring build.
[:app] Compiling ...
[:app] Build failure:
cannot find package.json for package react at /Users/wilkerlucio/Development/personal/multi-timer/node_modules/react/package.json
{:tag :shadow.build.npm/missing-package-json, :package-name "react", :package-json-file #object[java.io.File 0x55bcd296 "/Users/wilkerlucio/Development/personal/multi-timer/node_modules/react/package.json"]}
ExceptionInfo: cannot find package.json for package react at /Users/wilkerlucio/Development/personal/multi-timer/node_modules/react/package.json
clojure.core/ex-info (core.clj:4739)
clojure.core/ex-info (core.clj:4739)
shadow.build.npm/find-package* (npm.clj:126)
shadow.build.npm/find-package* (npm.clj:108)
shadow.build.npm/find-package (npm.clj:137)
shadow.build.npm/find-package (npm.clj:133)
shadow.build.resolve/eval20329/fn--20332 (resolve.clj:210)
clojure.lang.MultiFn.invoke (MultiFn.java:238)
you know what to do about this one?
/Users/wilkerlucio/Development/personal/multi-timer/node_modules/react
does it exist?
humm. looks like it
I saw that before in another react native apps, there is something wrong with npm resolution
on the other project it works it used to work if you keep running npm install
@wilkerlucio thanks, a workaround is less important than figuring out how to get this fixed so that I don’t have to add an extra instruction to all my READMEs 🙂
agreed, but sometimes we just need to get going 🙂
@mhuebert when you kill the server, rm -rf target/shadow-cljs
and start the server again. does the target/shadow-cljs
folder exist at least?
@thheller just tried that here, it doesn't seem to be creating it
I'm on mac here