LanguageModel Error in Chrome 137 with Extensions

374 views
Skip to first unread message

Scott Fortmann-Roe

unread,
May 25, 2025, 9:04:39 AM5/25/25
to chrome-ai-dev-...@chromium.org
Hello,

I've been developing a Chrome extension locally using the prompt API. I haven't whitelisted the extension for the origin trial but instead have set the Chrome flags to enable the on-device preview.

With Chrome 136 I could reference LanguageModel in this extension service worker and it would work well for development.

However, in Chrome 137 that has stopped working. I now get the error "Uncaught ReferenceError: LanguageModel is not defined" when trying to initialize the language model in the extension's service worker.

The same code that now fails in the extension's service worker runs without issue in a normal webpage in Chrome 137.

Kind regards, Scott

Thomas Steiner

unread,
May 26, 2025, 4:24:31 AM5/26/25
to Scott Fortmann-Roe, Sebastian Benz, chrome-ai-dev-...@chromium.org
Hi Scott,

Adding in @Sebastian Benz who may be aware of changes. It worked fine for me when I tested on Version 138.0.7200.0 (Official Build) canary (arm64).

Cheers,
Tom

--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ai-dev-preview-discuss/CAHqtauG11uOimQK-kz3Odr1-NqoqxQj8_Ydio2Rm%2B9pUnC7TCg%40mail.gmail.com.


--
Thomas Steiner, PhD—Developer Relations Engineer (blog.tomayac.comtoot.cafe/@tomayac)

Google Germany GmbH, ABC-Str. 19, 20354 Hamburg, Germany
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891

----- BEGIN PGP SIGNATURE -----
Version: GnuPG v2.4.3 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck
0fjumBl3DCharaCTersAttH3b0ttom.xKcd.cOm/1181.
----- END PGP SIGNATURE -----
Screenshot 2025-05-26 at 10.23.25.png

Scott Fortmann-Roe

unread,
May 26, 2025, 4:47:16 AM5/26/25
to Thomas Steiner, Sebastian Benz, chrome-ai-dev-...@chromium.org
Thanks Thomas. I've tested it in Chrome Canary and confirm it's working there for us.
--
Scott Fortmann-Roe
Co-founder and CTO of Text Blaze
Reply all
Reply to author
Forward
0 new messages