-
Notifications
You must be signed in to change notification settings - Fork 203
Description
This is an issue I get with the latest code (commit 76b3b12) and not with the released v0.10.1. I'm filing it in case it may prevent a bug in a future release, but sorry if it's already a known WIP issue. I'm not blocked since I'll use the released version.
I am getting an error with QuickJS and a bundle of prettier with a CLI interface using quickjs-libc instead of node.
cannot read property of null
I think an error in the bundle would be accompanied with a stack trace, as this is the only output I think it must be within the runtime? Though I can't find the string in this codebase so I'm not sure.
I originally found the issue with Wasm but the same issue occurs with a native build on MacOS.
Repro steps:
git clone https://github.com/wasilibs/go-prettier
cd go-prettier/buildtools/wasm
npm install
npm run build
wget https://raw.githubusercontent.com/envoyproxy/ai-gateway/1bbdb1e06df3dd355e6ba985e7ab00954bd548d6/manifests/charts/ai-gateway-crds-helm/templates/aigateway.envoyproxy.io_backendsecuritypolicies.yaml
jq -c --null-input --arg body "$(cat ./aigateway.envoyproxy.io_backendsecuritypolicies.yaml)" '{"name": "input", "body": $body}' | qjs --stack-size 2g ./dist/prettier.js '{"filepath": "envoy.yaml"}'
When using a release build, I get "cannot read property of null" without any --stack-size
setting. With a debug build I get "Maximum call stack size exceeded". Adding --stack-size 2g
causes it again become "cannot read property of null", so I guess it's stack-related and maybe that can provide some hint.