npm-opa-wasm icon indicating copy to clipboard operation
npm-opa-wasm copied to clipboard

A few issues in the example directory

Open 06kellyjac opened this issue 2 years ago • 10 comments

I'm getting Error: Cannot find module 'utf8' with both nodejs-app and nodejs-ts-app

Also with nodejs-ts-app it isn't resolving the type definitions properly so I made these changes to tsconfig:

"strict": false,
"noImplicitAny": false,

And the docs for nodejs-ts-app says to do npm run -- '{\"message\": \"world\" but that is wrong, it should be npm start -- '{\"message\": \"world\"

06kellyjac avatar Oct 04 '21 14:10 06kellyjac

Thanks for raising these! Would you be up to opening a PR, or should we make this is as good-first-issue?

srenatus avatar Oct 05 '21 08:10 srenatus

Im happy to open a PR for the tsconfig and npm start but I have no idea where to start with the UTF8 issue

06kellyjac avatar Oct 05 '21 08:10 06kellyjac

I think all the example apps are running on CI...? so, what's your node version?

srenatus avatar Oct 05 '21 08:10 srenatus

I was using 14.17.6 I can try a couple of versions and note incompatibilities in the README

If you know what works in CI thatd help too

06kellyjac avatar Oct 05 '21 09:10 06kellyjac

https://github.com/open-policy-agent/npm-opa-wasm/actions/runs/1244485210 We're testing with Node 12.x and 14.x

srenatus avatar Oct 05 '21 09:10 srenatus

👍

Ill try specific node and opa versions

my OPA was 0.33.1 I tried a local build (using nix) and the release build from GH. I just noticed it says WebAssembly: Unavailable on the one from GH and I'm not confident my local build has actually built with working WebAssembly. Is that feature flag for compiling WASM or just for running WASM?

I guess I should do a full make wasm-test to verify

Also how come deno is added?

06kellyjac avatar Oct 05 '21 09:10 06kellyjac

Any OPA binary can produce wasm bundles (which contain the policy.wasm modules). Only OPA binaries with "WebAssembly: available" can evaluate wasm.

So for this, don't worry about the version output.

srenatus avatar Oct 05 '21 09:10 srenatus

Also how come deno is added?

Can you elaborate please? Where's the unexpected appearance? I've recently added linting and formatting using deno in CI, because it seemed like an easy way forward.

srenatus avatar Oct 05 '21 09:10 srenatus

@06kellyjac Did you ever get past this? 😃

srenatus avatar Oct 20 '21 11:10 srenatus

Sorry. Yeah I couldnt recreate some of the issues. Ill try get any of my actually useful changes in a PR over the next day or so

06kellyjac avatar Oct 20 '21 11:10 06kellyjac

I'll clean this up as stale, I hope you don't mind. Feel free to re-open.

srenatus avatar May 23 '24 08:05 srenatus