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

UglifyJS getting errors #2

Open
couturecraigj opened this issue Oct 26, 2017 · 0 comments
Open

UglifyJS getting errors #2

couturecraigj opened this issue Oct 26, 2017 · 0 comments

Comments

@couturecraigj
Copy link

I have been trying out WebAssembly and the wargo build is working well but I would really like to see if I can get this to work with uglify.
this is my error

Invalid assignment [./~/wargo-loader??ref--0!./src/main.rs:5,0][main_d6f3bb21cd455f866c7c.js:86707,47]

and this is what I am doing with my code before all that nonsense hashing.

if (typeof WebAssembly === 'object') {
  if (process.env.NODE_ENV === 'development') {
    setTimeout(() => {
      UberFunctions = getBinaryFunctions(window.Module)
      window.UberFunctions = UberFunctions
    }, 1000)
  } else {
    const wasm = require('../src/main.rs')
    wasm.initialize({ noExitRuntime: true })
    .then(mod => {
      UberFunctions = getBinaryFunctions(mod)
      window.UberFunctions = UberFunctions
      console.log(UberFunctions.add(1, 2), UberFunctions.subtract(5, 4), UberFunctions.multiply(20, 500), UberFunctions.divide(24.48, 400), 24.48 / 400)
    })
  }
  setTimeout(() => {
    console.log(UberFunctions.add(1, 2), UberFunctions.subtract(5, 4), UberFunctions.multiply(20, 500), UberFunctions.divide(24.48, 400), 24.48 / 400)
  }, 1000)
}

Do you have any suggestions. Makes building rust to WASM super fast great tool!

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

No branches or pull requests

1 participant