The Vega 0.22 WebView Component Reference (last updated May 11) documents injectedJavaScriptBeforeContentLoaded. However, the only version of @amazon-devicesamazon-devices/webview published to the public npm registry is 3.3.1769932800 (latest tag, ~8 months old), and that package does not expose injectedJavaScriptBeforeContentLoaded anywhere.
Bug Severity
Select one that applies
Impacts operation of app
Blocks current development
Improvement suggestion
Issue with documentation (If selected, please share the doc link and describe the issue)
In a Vega project, install @amazon-devices/webview (resolves to 3.3.1769932800)
Use the prop: <WebView injectedJavaScriptBeforeContentLoaded={āā¦ā}
TypeScript error: property does not exist on the WebView props type
3. Observed Behavior
injectedJavaScriptBeforeContentLoaded is entirely absent from the package's .d.ts files.
4. Expected Behavior
The prop is to be working as per the doc page on the publicly distributed @amazon-devices/webview.
4.a Possible Root Cause & Temporary Workaround
Workaround currently in use: webviewRef.current?.injectJavaScript(ā¦) from onLoadStart, but this is not ideal, would like to set window object values of API information to the webView before its loaded.
5. Logs or crash report
Property āinjectedJavaScriptBeforeContentLoadedā does not exist on type āIntrinsicAttributes & KeplerWebViewProps & RefAttributesā
6. Environment
Please fill out the fields related to your bug below:
SDK Version: Active SDK Version: 0.22.6759
Vega CLI Version: 1.2.22
7. Example Code Snippet / Screenshots / Screengrabs
I donāt think the tool used to download/install the packages is relevant here, as the link to the (one and only) NPM registry clearly shows there are no different versions released for the webview package.
However, to answer the question: Iām using NPM 11.12.1.
As you would expect this doesnāt work. The package version doesnāt exist (once again, check the link I shared).
npm install @amazon-devicesamazon-devices/webview@3.5.10
npm error code ETARGET
npm error notarget No matching vers@amazon-deviceson found for @amazon-devices/webview@3.5.10.
npm error notarget In most cases you or one of your dependencies are requesting a package version that doesnāt exist.
Weāve identified the root cause of this issue. The currently public exported npm package is webview v3.3.17, which does not include the injectedJavaScriptBeforeContentLoaded API - that feature was introduced in v3.5.x, which hasnāt been released to customers yet.
Requesting you to please wait for the next release (v0.23) , which is expected soon.
Thank you for identifying this issue and helping us make Vega better.