Fork me on GitHub
#shadow-cljs
<
2018-12-25
>
Ivan Fedorov10:12:51

Hi fellas! Bumped into Uncaught Error: No protocol method IMapEntry.-key defined for type object: (:page-id "notes") Happens when code was generated with release compilation in secretary on some ubuntu linux (14.04 LTS). Same sources compile differently [;)] on macOS High Sierra and don’t cause any trouble after. Versions macOS shadow-cljs 6.4.1 lein 2.8.1 ubuntu shadow-cljs 6.4.1 lein 2.6.1

thheller10:12:46

(:page-id "notes") what is that? that is not valid code?

Ivan Fedorov10:12:30

Yep, this is an artifact after compilation on ubuntu system

thheller10:12:57

check if lein deps :tree is different on the systems

thheller10:12:09

maybe you have something in your ~/.lein/profiles.clj?

Ivan Fedorov10:12:16

thanks! a moment

thheller10:12:50

hmm those don't affect the compiler. there is nothing system dependent in the compiler at all.

thheller10:12:23

does the error appear when compiling with shadow-cljs release your-build --pseudo-names?

thheller10:12:00

I suspect you have an externs issue. they behave very weirdly.

Ivan Fedorov10:12:13

jvms may also be different, I think

thheller10:12:21

shouldn't matter really

thheller10:12:09

it probably is just externs. you can confirm that if the error goes away with --pseudo-names pretty much

Ivan Fedorov10:12:22

yep, trying it

Ivan Fedorov10:12:52

issue persists

thheller10:12:21

hmm at least the error should change?

thheller10:12:03

do you have a full stacktrace?

Ivan Fedorov10:12:18

yup, full stracktrace

app.js?mtime=1545734833000:1642 Uncaught Error: No protocol method IMapEntry.-key defined for type object: (:page-id "notes")
    at $cljs$core$missing_protocol$$ (app.js?mtime=1545734833000:1642)
    at $cljs$core$_key$$ (app.js?mtime=1545734833000:1883)
    at app.js?mtime=1545734833000:10170
    at $cljs$core$seq_reduce$cljs$0core$0IFn$0_invoke$0arity$03$$ (app.js?mtime=1545734833000:3895)
    at $cljs$core$Cons$$.$JSCompiler_prototypeAlias$$.$cljs$core$IReduce$_reduce$arity$3$ (app.js?mtime=1545734833000:4523)
    at $cljs$core$reduce$cljs$0core$0IFn$0_invoke$0arity$03$$ (app.js?mtime=1545734833000:3951)
    at app.js?mtime=1545734833000:10167
    at $cljs$core$array_reduce$cljs$0core$0IFn$0_invoke$0arity$04$$ (app.js?mtime=1545734833000:2864)
    at $cljs$core$IndexedSeq$$.$JSCompiler_prototypeAlias$$.$cljs$core$IReduce$_reduce$arity$2$ (app.js?mtime=1545734833000:3016)
    at $cljs$core$reduce$cljs$0core$0IFn$0_invoke$0arity$02$$ (app.js?mtime=1545734833000:3947)
$cljs$core$missing_protocol$$ @ app.js?mtime=1545734833000:1642
$cljs$core$_key$$ @ app.js?mtime=1545734833000:1883
(anonymous) @ app.js?mtime=1545734833000:10170
$cljs$core$seq_reduce$cljs$0core$0IFn$0_invoke$0arity$03$$ @ app.js?mtime=1545734833000:3895
$JSCompiler_prototypeAlias$$.$cljs$core$IReduce$_reduce$arity$3$ @ app.js?mtime=1545734833000:4523
$cljs$core$reduce$cljs$0core$0IFn$0_invoke$0arity$03$$ @ app.js?mtime=1545734833000:3951
(anonymous) @ app.js?mtime=1545734833000:10167
$cljs$core$array_reduce$cljs$0core$0IFn$0_invoke$0arity$04$$ @ app.js?mtime=1545734833000:2864
$JSCompiler_prototypeAlias$$.$cljs$core$IReduce$_reduce$arity$2$ @ app.js?mtime=1545734833000:3016
$cljs$core$reduce$cljs$0core$0IFn$0_invoke$0arity$02$$ @ app.js?mtime=1545734833000:3947
$cljs$core$merge_with$$.$cljs$core$IFn$_invoke$arity$variadic$ @ app.js?mtime=1545734833000:10165
(anonymous) @ app.js?mtime=1545734833000:17692
$secretary$core$route_matches$$ @ app.js?mtime=1545734833000:17509
(anonymous) @ app.js?mtime=1545734833000:17716
$cljs$core$some$$ @ app.js?mtime=1545734833000:5440
$secretary$core$locate_route$$ @ app.js?mtime=1545734833000:17713
$secretary$core$dispatch_BANG_$$ @ app.js?mtime=1545734833000:17726
$app$routes$on_goog_navigate$$ @ app.js?mtime=1545734833000:17977
$JSCompiler_StaticMethods_fireListeners$$ @ app.js?mtime=1545734833000:17459
$goog$events$EventTarget$$.dispatchEvent @ app.js?mtime=1545734833000:17440
$app$routes$on_window_click$$ @ app.js?mtime=1545734833000:17970

thheller10:12:05

where is the rest?

Ivan Fedorov11:12:12

sorry, updated

thheller11:12:41

hmm. so the only thing I can think of thats actually different between the systems is the cache

thheller11:12:58

try deleting .shadow-cljs/builds

thheller11:12:11

that'll reset the cache

Ivan Fedorov11:12:28

sure! maybe .m2 as well for a good company?

thheller11:12:42

but --pseudo-names didn't use the cache either so it really shouldn't matter

thheller11:12:57

nah .m2 usually doesn't need to be deleted

thheller11:12:25

I assume the issue didn't happen with shadow-cljs compile your-build?

Ivan Fedorov11:12:50

haven’t tried on ubuntu server, will do in few mins

Ivan Fedorov11:12:55

macOS compile and release always produced healthy bundles

thheller11:12:15

I have no idea how the OS could make any difference, never heard of any such issue

Ivan Fedorov11:12:54

Ahem. Dear sir, please accept my resignation as I didn’t had a yarn.lock file in the repo index. Fixed it all.

Ivan Fedorov11:12:05

Found it when I tried to reproduce compile on the remote host.

thheller11:12:22

weird. how does that affect the CLJS code though?

Ivan Fedorov11:12:34

Thank you for guidance and responsiveness! ❤️❤️🍺🍺

Ivan Fedorov11:12:59

I guess cljs might take some decisions based on env

Ivan Fedorov11:12:21

or even different cljs versions?

thheller11:12:36

well, best not to look to close at npm stuff 😉

Ivan Fedorov11:12:37

is there a way to dump npm dep-tree used in compilation? If we’re interested

thheller11:12:18

build reports contain everything that went into the build but besides that there are only the common npm tools

Ivan Fedorov11:12:57

any chance to send you a beer over Patreon or smth?

thheller11:12:30

still need to set that up 😉