antelle / argon2-browser

Argon2 library compiled for browser runtime
https://antelle.net/argon2-browser
MIT License
367 stars 79 forks source link

Cannot read property 'push' of undefined undefined #31

Closed 382303784 closed 4 years ago

382303784 commented 4 years ago

hi, I rebuilt this project, but it seems to be a problem.

//environment ubuntu 16.04 nodejs 10.x.x

//Install emsdk https://webassembly.org/getting-started/developers-guide/

//rebuild ./build.sh

//run const argon2=require('./lib/argon2') argon2.hash({ pass: 'password', salt: 'somesalt' }) .then(h => console.log(h.hash, h.hashHex, h.encoded)) .catch(e => console.error(e.message, e.code))

//result Cannot read property 'push' of undefined undefined

antelle commented 4 years ago

Hi! Stack trace please.

382303784 commented 4 years ago

Hi! Stack trace please.

OK.All here.

TypeError: Cannot read property 'push' of undefined
TypeError: Cannot read property 'push' of undefined

E:\work\czr-remix-ide\czr\czr_account.js\node_modules\argon2-browser\dist\argon2.js:63
            throw ex
            ^
abort(TypeError: Cannot read property 'push' of undefined). Build with -s ASSERTIONS=1 for more info.

//E:\work\czr-remix-ide\czr\czr_account.js\node_modules\argon2-browser\dist\argon2.js:63


process["on"]("uncaughtException", function (ex) {
        if (!(ex instanceof ExitStatus)) {
            throw ex
        }
    })
antelle commented 4 years ago

What's your emscripten version?

382303784 commented 4 years ago

I am installing emsdk:

./emsdk install latest

so,emscripten version is 1.38.42

antelle commented 4 years ago

I'm on 1.38.40. If you see a line number here: argon2.js:63, this means it's not compiled successfully (it must be one line). I can't reproduce it, not sure how I can help, looks like you need to fight it somehow.

382303784 commented 4 years ago

Originally one line, I formatted it for convenience.

The error before formatting is: argon2.js:1

I am sorry, I forgot to tell you that I formatted the code.

382303784 commented 4 years ago

Hi! I think I found the problem, I used the 1.38.40 version to rebuild, and then it can be successful.

But I don't know why this error occurs with the 1.38.42 version.

Thank you very much for your help.

antelle commented 4 years ago

1.38.42 is not released yet ;)

Once it becomes latest, if it still repeats then, I’ll take a look.

antelle commented 4 years ago

No, that's actually latest now, so we should fix it.

antelle commented 4 years ago

Fixed, published 1.10.0 ☺️

antelle commented 4 years ago

Now we have CI, which builds on latest emscripten.

382303784 commented 4 years ago

that`s great!