npm-opa-wasm
npm-opa-wasm copied to clipboard
A few issues in the example directory
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\"
Thanks for raising these! Would you be up to opening a PR, or should we make this is as good-first-issue?
Im happy to open a PR for the tsconfig and npm start but I have no idea where to start with the UTF8 issue
I think all the example apps are running on CI...? so, what's your node version?
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
https://github.com/open-policy-agent/npm-opa-wasm/actions/runs/1244485210 We're testing with Node 12.x and 14.x
👍
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?
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.
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.
@06kellyjac Did you ever get past this? 😃
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
I'll clean this up as stale, I hope you don't mind. Feel free to re-open.