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

[BUG] Different behaviour between a normal compilation and a compilation with the --profile=release #1522

Closed
xvw opened this issue Nov 9, 2023 · 3 comments · Fixed by #1528
Labels

Comments

@xvw
Copy link
Contributor

xvw commented Nov 9, 2023

Describe the bug
I notice a different behaviour between a normal compilation and a compilation with the --profile=release flag for handling rejections in promises. I haven't really managed to isolate the problem so I'm sorry for the limited information I can provide. This is always the case when developing an application that interacts with the Tezos chain. Here's the difference between "normal" compilation (in development) and compilation with the --profile=release flag:

compiling without --profile=release

Here the application is launched in dev mode, the bundle is ~16mb
image

I can click on syncrhonize Wallet
image

After some step connecting through the wallet, everything is fine:
image

(And the application works)

compiling with --profile=release

Here the application is launched in release mode, the bundle is ~1.20mb
image

I have the same first screen (which is an huge progress since the new patches)
image

And I follow the instruction like in "dev" mode, but when I select my wallet, I face to :
image

So the error is a Promise rejection, which does not appear in "dev" mode. Here is the stack:

18:58:26.784 request-permissions-rejection, Nightmare_js__Promise.Promise_rejection(_) capsule_client.bc.js:9868:329
    dB http://localhost:8888/js/capsule_client.bc.js:9868
    h http://localhost:8888/js/capsule_client.bc.js:7715
    c_ http://localhost:8888/js/capsule_client.bc.js:9868
    n http://localhost:8888/js/capsule_client.bc.js:12493
    h http://localhost:8888/js/capsule_client.bc.js:7715
    f http://localhost:8888/js/capsule_client.bc.js:9735
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    po http://localhost:8888/js/capsule_client.bc.js:9717
    f http://localhost:8888/js/capsule_client.bc.js:9724
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    po http://localhost:8888/js/capsule_client.bc.js:9717
    f http://localhost:8888/js/capsule_client.bc.js:9724
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    po http://localhost:8888/js/capsule_client.bc.js:9717
    g http://localhost:8888/js/capsule_client.bc.js:9755
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    f http://localhost:8888/js/capsule_client.bc.js:9733
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    pk http://localhost:8888/js/capsule_client.bc.js:9705
    d7 http://localhost:8888/js/capsule_client.bc.js:9847
    e http://localhost:8888/js/capsule_client.bc.js:7362
    (Async: promise callback)
    aFi http://localhost:8888/js/capsule_client.bc.js:7363
    d7 http://localhost:8888/js/capsule_client.bc.js:9847
    m http://localhost:8888/js/capsule_client.bc.js:12499
    h http://localhost:8888/js/capsule_client.bc.js:7715
    kl http://localhost:8888/js/capsule_client.bc.js:9747
    e http://localhost:8888/js/capsule_client.bc.js:12499
    h http://localhost:8888/js/capsule_client.bc.js:7715
    f http://localhost:8888/js/capsule_client.bc.js:9722
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    f http://localhost:8888/js/capsule_client.bc.js:9737
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    pk http://localhost:8888/js/capsule_client.bc.js:9705
    d http://localhost:8888/js/capsule_client.bc.js:9847
    f http://localhost:8888/js/capsule_client.bc.js:7361
    (Async: promise callback)
    aFi http://localhost:8888/js/capsule_client.bc.js:7363
    d7 http://localhost:8888/js/capsule_client.bc.js:9847
    J http://localhost:8888/js/capsule_client.bc.js:12502
    h http://localhost:8888/js/capsule_client.bc.js:7715
    hK http://localhost:8888/js/capsule_client.bc.js:9768
    J http://localhost:8888/js/capsule_client.bc.js:12483
    o http://localhost:8888/js/capsule_client.bc.js:7716
    lx http://localhost:8888/js/capsule_client.bc.js:12025
    lx http://localhost:8888/js/capsule_client.bc.js:12020
    h http://localhost:8888/js/capsule_client.bc.js:7715
    V http://localhost:8888/js/capsule_client.bc.js:7901
    lx http://localhost:8888/js/capsule_client.bc.js:12020
    D http://localhost:8888/js/capsule_client.bc.js:12465
    m http://localhost:8888/js/capsule_client.bc.js:12462
    h http://localhost:8888/js/capsule_client.bc.js:7715
    m http://localhost:8888/js/capsule_client.bc.js:12440
    o http://localhost:8888/js/capsule_client.bc.js:7716
    cG http://localhost:8888/js/capsule_client.bc.js:7905
    e http://localhost:8888/js/capsule_client.bc.js:12439
    h http://localhost:8888/js/capsule_client.bc.js:7715
    jC http://localhost:8888/js/capsule_client.bc.js:7867
    e http://localhost:8888/js/capsule_client.bc.js:12426
    dp http://localhost:8888/js/capsule_client.bc.js:6648
    m6 http://localhost:8888/js/capsule_client.bc.js:7160
    (Async: EventListener.handleEvent)
    H http://localhost:8888/js/capsule_client.bc.js:12456
    h http://localhost:8888/js/capsule_client.bc.js:7715
    sT http://localhost:8888/js/capsule_client.bc.js:12068
    h http://localhost:8888/js/capsule_client.bc.js:7715
    V http://localhost:8888/js/capsule_client.bc.js:7901
    sT http://localhost:8888/js/capsule_client.bc.js:12060

18:58:26.784 Impossible de connecter le wallet capsule_client.bc.js:9868:329
    dB http://localhost:8888/js/capsule_client.bc.js:9868
    h http://localhost:8888/js/capsule_client.bc.js:7715
    c_ http://localhost:8888/js/capsule_client.bc.js:9868
    n http://localhost:8888/js/capsule_client.bc.js:12493
    h http://localhost:8888/js/capsule_client.bc.js:7715
    f http://localhost:8888/js/capsule_client.bc.js:9735
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    po http://localhost:8888/js/capsule_client.bc.js:9717
    f http://localhost:8888/js/capsule_client.bc.js:9724
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    po http://localhost:8888/js/capsule_client.bc.js:9717
    f http://localhost:8888/js/capsule_client.bc.js:9724
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    po http://localhost:8888/js/capsule_client.bc.js:9717
    g http://localhost:8888/js/capsule_client.bc.js:9755
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    f http://localhost:8888/js/capsule_client.bc.js:9733
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    pk http://localhost:8888/js/capsule_client.bc.js:9705
    d7 http://localhost:8888/js/capsule_client.bc.js:9847
    e http://localhost:8888/js/capsule_client.bc.js:7362
    (Async: promise callback)
    aFi http://localhost:8888/js/capsule_client.bc.js:7363
    d7 http://localhost:8888/js/capsule_client.bc.js:9847
    m http://localhost:8888/js/capsule_client.bc.js:12499
    h http://localhost:8888/js/capsule_client.bc.js:7715
    kl http://localhost:8888/js/capsule_client.bc.js:9747
    e http://localhost:8888/js/capsule_client.bc.js:12499
    h http://localhost:8888/js/capsule_client.bc.js:7715
    f http://localhost:8888/js/capsule_client.bc.js:9722
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    f http://localhost:8888/js/capsule_client.bc.js:9737
    h http://localhost:8888/js/capsule_client.bc.js:7715
    d http://localhost:8888/js/capsule_client.bc.js:9690
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    pg http://localhost:8888/js/capsule_client.bc.js:9693
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    h http://localhost:8888/js/capsule_client.bc.js:7715
    ph http://localhost:8888/js/capsule_client.bc.js:9694
    dA http://localhost:8888/js/capsule_client.bc.js:9697
    pk http://localhost:8888/js/capsule_client.bc.js:9705
    d http://localhost:8888/js/capsule_client.bc.js:9847
    f http://localhost:8888/js/capsule_client.bc.js:7361
    (Async: promise callback)
    aFi http://localhost:8888/js/capsule_client.bc.js:7363
    d7 http://localhost:8888/js/capsule_client.bc.js:9847
    J http://localhost:8888/js/capsule_client.bc.js:12502
    h http://localhost:8888/js/capsule_client.bc.js:7715
    hK http://localhost:8888/js/capsule_client.bc.js:9768
    J http://localhost:8888/js/capsule_client.bc.js:12483
    o http://localhost:8888/js/capsule_client.bc.js:7716
    lx http://localhost:8888/js/capsule_client.bc.js:12025
    lx http://localhost:8888/js/capsule_client.bc.js:12020
    h http://localhost:8888/js/capsule_client.bc.js:7715
    V http://localhost:8888/js/capsule_client.bc.js:7901
    lx http://localhost:8888/js/capsule_client.bc.js:12020
    D http://localhost:8888/js/capsule_client.bc.js:12465
    m http://localhost:8888/js/capsule_client.bc.js:12462
    h http://localhost:8888/js/capsule_client.bc.js:7715
    m http://localhost:8888/js/capsule_client.bc.js:12440
    o http://localhost:8888/js/capsule_client.bc.js:7716
    cG http://localhost:8888/js/capsule_client.bc.js:7905
    e http://localhost:8888/js/capsule_client.bc.js:12439
    h http://localhost:8888/js/capsule_client.bc.js:7715
    jC http://localhost:8888/js/capsule_client.bc.js:7867
    e http://localhost:8888/js/capsule_client.bc.js:12426
    dp http://localhost:8888/js/capsule_client.bc.js:6648
    m6 http://localhost:8888/js/capsule_client.bc.js:7160
    (Async: EventListener.handleEvent)
    H http://localhost:8888/js/capsule_client.bc.js:12456
    h http://localhost:8888/js/capsule_client.bc.js:7715
    sT http://localhost:8888/js/capsule_client.bc.js:12068
    h http://localhost:8888/js/capsule_client.bc.js:7715
    V http://localhost:8888/js/capsule_client.bc.js:7901
    sT http://localhost:8888/js/capsule_client.bc.js:12060

Here is ... the line (I guess)

o=function(a){return aD.detachEvent(f,g)}}j[1]=o;return c8(l,x)},aiJ=function(a,b){a.nightmare.suspending.push(b);return 0},hN=ac4(0),aiK={nightmare:{suspending:jo([0])},suspend:jq(aiJ),mount:jq(aiI)},kt=function(a){return hN.log(a)},aiM=function(a){return hN.info(a)},pB=function(a){return hN.warn(a)},dB=function(a){return hN.error(a)},c_=function(a,b){return h(a,L(b))},aiW=function(a){var

And as always, here is the full javascript bundle : https://gist.github.com/xvw/2a7c83da66b153972f33b0feedfac339

It's difficult to give more context, so here are the packages used:

A side, here is the "dev mode" generated bundle (if it helps) https://gist.github.com/xvw/f814646dce98d3a85f5e1880a1631517

Thanks a lot, if I can give more context, feel free to ask.

Versions
I still use the master version of JSOO, everything is defined here: https://github.com/xvw/capsule/blob/main/capsule.opam

@xvw xvw added the bug label Nov 9, 2023
@xvw
Copy link
Contributor Author

xvw commented Nov 10, 2023

More context, using the flag --pretty (that gives this file https://gist.github.com/xvw/8a90470ca68c9876b61ffbdd34717f8b) the error is gone. So it seems that it is an error from the minimizer.
Using --disable inline (without the flag pretty) I still have the error 11032:70 (using that file : https://gist.github.com/xvw/e2b7ea47b4743babb3d68facf9087b7a

@hhugo
Copy link
Member

hhugo commented Nov 11, 2023

I spotted a bug in the variable renaming logic regarding class. fixed in #1524. I've no idea if this is related to your issue.

@xvw
Copy link
Contributor Author

xvw commented Nov 12, 2023

as mentionned with @hhugo, disabling shortvar fixe the issue (generated bundle https://gist.github.com/xvw/97683af0d6f866224a8833b743848830) !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants