WebView prop documented in v0.22 reference is missing from the published npm package


:backhand_index_pointing_right: Bug Description


1. Summary

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)
  • Other

2. Steps to Reproduce

  1. Open https://developer.amazon.com/docs/vega-api/0.22/webview-component-reference.html` and locate injectedJavaScriptBeforeContentLoaded.`
  2. In a Vega project, install @amazon-devices/webview (resolves to 3.3.1769932800)
  3. Use the prop: <WebView injectedJavaScriptBeforeContentLoaded={ā€œā€¦ā€}
  4. 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

<WebView
  source={{ uri: 'https://reactnative.dev' }}
  injectedJavaScriptBeforeContentLoaded={INJECTED_JAVASCRIPT}

Hello @lamoule

Welcome to Amazon Developer Community!!
Thank you for reporting this, I’m looking into this and will come back with an update ASAP.

Warm Regards,
Ivy

Hello @lamoule

I can confirm that the injectedJavaScriptBeforeContentLoaded API was not included in the @amazon-devices/webview@3.3.17 release.

This API is, however, available starting in version 3.5.10.
For now, can you please use 3.5.10 or higher ?

Warm Regards,
Ivy

Hi @Ivy,

I’m also experiencing the same issue. You suggest using a newer version of the package but there isn’t one. Only a single version is available on NPM and that is 3.3.1769932800: https://www.npmjs.com/package/@amazon-devices/webview?activeTab=versions

Would it be possible to publish this 3.5.10 version?

Thanks

Hello @niels

Welcome to Amazon Developer Community!
Quick question, how are you downloading and installing npm package?

Warm regards,
Ivy

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.

@niels thank you for sharing.

Could you please install the latest WebView NPM version using
npm install @amazon-devices/webview@3.5.10 and let us know if the issue resolved?

Warm regards,
Ivy

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.

Hey @Ivy As niels mentioned, this package is not available. The only available version is 3.3.1769932800

@lamoule , Thanks for confirming.
We are investigating this internally and I’ll update you ASAP.

Warm Regards,
Ivy

Hey @Ivy any update on this issue ? thanks

Hey @lamoule

We are working on this isue, I’ll update you ASAP.

Warm regards,
Ivy

Hello @lamoule , @niels

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.

Warm regards,
Ivy