Hi Community, I'm looking for help to install the Vertex AI search for a website project. Greatly appreciate any input on the below!
Issue:
Trying to setup the US version of the search and receiving an odd error message when query is sent through the widget search bar. The error is persisting and no results are displayed.
2 Error messages alternating:
[Error] Unhandled Promise Rejection: TypeError: t.replace is not a function. (In 't.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g,"\\$&")', 't.replace' is undefined)
(anonymous function) (m=bootstrap_module,ucs_widget_module:497:513)
[Error] Unhandled Promise Rejection: TypeError: t.replace is not a function. (In 't.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g,"\\$&")', 't.replace' is undefined)
Kl (m=bootstrap_module,ucs_widget_module:493:188)
(anonymous function) (m=bootstrap_module,ucs_widget_module:498)
Thank you for your time
Hello @lallerton1978,
The t.replace is not a function error occurs when the search widget receives invalid input, likely a non-string query or misconfigured language settings. To resolve this, verify the widget’s initialization ensures string-only inputs, confirm the US Datastore is properly linked, and explicitly set languageCode: 'en-US' in the config. Additionally, inspect network requests for malformed API calls and test with hardcoded queries to isolate the issue. If problems persist, compare US settings against working language configurations for discrepancies.
Some key steps you may try:
Best regards,
Suwarna
Hi lallerton1978,
Welcome to the Google Cloud Community!
In addition to @SuwarnaKale 's input, this JavaScript error in your Vertex AI Search widget likely means that replace function is being called on something that isn't a string (probably undefined or null). Here are some approaches that might resolve the issue:
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |