Fork me on GitHub
#shadow-cljs
<
2020-08-08
>
metasoarous14:08:02

Does anyone know why I'd be getting the following from a shadow-cljs release build?

shadow-cljs - failed to load
I'm pulling my hair out here trying to figure out what's going on.

metasoarous14:08:04

Possibly related, all of my minified builds are giving me errors like

app.js:1994 Uncaught TypeError: $jscomp.inherits is not a function
    at app.js:1994
    at app.js:1645
    at Object.shadow$provide.<computed> (app.js:1645)
    at vs (app.js:2831)
    at app.js:2211
    at Object.shadow$provide.<computed> (app.js:2211)
    at vs (app.js:2831)
    at app.js:3230
    at app.js:3271

metasoarous14:08:13

Trying to cut a new release of https://github.com/metasoarous/oz, and shit is just not working. I didn't really even change very much since the last working release and when things starting going haywire.

metasoarous14:08:08

Last working release was 1.6.0-alpha15

metasoarous14:08:55

There's a Makefile in there with build and release tasks which document how I've been doing this.

metasoarous14:08:30

The Uncaught TypeError is the real issue, as it's preventing the app from loading and doing The Thing. But it seems to be related to some weird shadow shenanigans that I've been unable to sort out.

metasoarous14:08:58

For a while the error that was coming up was a little different:

TypeError: $jscomp.asyncExecutePromiseGeneratorProgram is not a function
at La.q.runAsync (app.js:492)
at $jscomp.generator.Engine_.program_ (app.js:2153)
at $jscomp.generator.Engine_.nextStep_ (app.js:20)
at $jscomp.generator.Engine_.next_ (app.js:16)
at $jscomp.generator.Generator_.next (app.js:21)
at app.js:2125
at new Promise (<anonymous>)
at N (app.js:2124)
at Pc (app.js:2148)
at $jscomp.generator.Engine_.program_ (app.js:2146)
at $jscomp.generator.Engine_.nextStep_ (app.js:20)
at $jscomp.generator.Engine_.next_ (app.js:16)
at $jscomp.generator.Generator_.next (app.js:21)
at t (app.js:2124)

metasoarous14:08:21

Tried updating shadow, and now it's the other (seemingly related) error

thheller15:08:01

@metasoarous this is a problem with polyfills. I thought I fixed all those. guess I didn't. an easy fix is adding :compiler-options {:output-feature-set :es8} to your build config.

metasoarous16:08:05

Hey @U05224H0W! Thanks for the quick response! I've verified that it's working with the :es8 featureset. Strangely though, when I then comment out that line and recompile it works again! Also, I may be crazy or have missed something, but I had it working yesterday again and then it just stopped. Is there any reason it would be misbehaving intermittently like this? Also very strange that it just magically started breaking with me not having changed very much.

thheller16:08:12

did you upgrade the shadow-cljs version? I did a bunch of changes in this area in the past few releases trying to fix this. It manifests in so many different ways so I guess I missed some.

metasoarous16:08:34

I didn't when the issue first popped up. Later I updated to try and fix it.

metasoarous16:08:36

That's when it went from TypeError: $jscomp.asyncExecutePromiseGeneratorProgram is not a function to TypeError: $jscomp.inherits is not a function.

metasoarous16:08:47

But the first of those errors seemingly popped up out of nowhere

metasoarous17:08:58

One more potentially pertinent detail; While, as I said, I don't remember changing anything about my Shadow setup, I did run some devcards with shadow-cljs watch which I hadn't done in a while. And with the weirdness of turning on/off :es8 targeting fixing things, I wonder if this could have something to do with information Shadow is caching that isn't getting cleared out?

thheller15:08:33

I'll see if I can reproduce this locally and try to figure out whats happening

metasoarous16:08:00

Amazing; Thanks so much!

awcot15:08:12

Hi, I'm having some trouble getting set up using shadow-cljs: npx create-cljs-project my-project All OK. cd my-project npx shadow-cljs

Could not find shadow-cljs.edn config file.
To create one run:
  shadow-cljs init
OK... It's definitely in there though. Looks like it can't find it? Using node v12.18.3. The only thing I can run is npx shadow-cljs help 😅 . Also tried installing globally, no different... Thx

thheller15:08:38

@alexandercotton1996 oops I messed up the last release. just pushed 2.10.21 which fixes this. run npm install [email protected] in the project dir to fix it

awcot15:08:36

Nice! That works, many thanks

👍 3
benny17:08:43

any idea why i would randomly start getting

no dispatch macro for s
for the shadow reader like so
:closure-defines  {client.config/api-base-url #shadow/env "API_URL"}

benny17:08:17

looks like a bug with a newer version

benny17:08:19

i’ll submit a bug

thheller21:08:43

@benny I think the problem is that API_URL might not be set? you can try #shadow/env ["API_URL" "default-value"]?

benny21:08:10

that’s true, but in 2.10.18 it doesn’t care. that profile isn’t being used, so i wouldn’t even expect it to be evaluated

thheller21:08:13

can't stop the reader from not trying to use it. for some reason the CLJS tools.reader doesn't allow reader conditionals that return nil/false. looks like a bug in tools.reader.