error occurred in your use of the Zendesk Widget API (prefill) | Community
Skip to main content

error occurred in your use of the Zendesk Widget API (prefill)

  • February 23, 2022
  • 5 replies
  • 0 views

Need help please! This is exactly what I have on my <script>:
https://developer.zendesk.com/api-reference/widget/core/#prefill

Everything is good and working with the zendesk widget on our rails app but this keeps on showing on the browser console when routing on a different page of the app. This does not occur on the first page load:

Thanks

5 replies

Hi Khris,
 
When this happens, does the widget appear on the page at all?  Are you able to open it and fill out the form?
 
Best,
 

  • Author
  • March 3, 2022

@christopher53, the widget appears and it's loading everything and yes i am able to fill it out and use the zendesk fine but this error is constantly appearing everytime you click on a different route but when you refresh it's not there (only happens when you move to a different route).


Hi Khris,
 
Thanks for the context.  Is the front end a single page app?  Also, can you share the code you're using to prefill the form?
 
Best,
 

  • Author
  • March 8, 2022
<script type="text/javascript">
zE('webWidget', 'prefill', {
name: {
value: "<%= current_user.full_name %>",
readOnly: true
},
email: {
value: "<%= current_user.email %>",
readOnly: true
},
});
</script>

It's the same as what the documentation suggested. And no the fe is not a spa.


Hi KP,

I've created a ticket to take a deeper dive into specific details about your implementation.

Best,