<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CORS Policy Errors + ServiceWorker Errors in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/CORS-Policy-Errors-ServiceWorker-Errors/m-p/1058462#M77563</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/845582"&gt;@PRoehm&lt;/a&gt;&amp;nbsp; the secure endpoint doesn't support cors at all, you can see this warning in the documentation &lt;A href="https://legacydocs.hubspot.com/docs/methods/forms/submit_form_v3_authentication#:~:text=While%20endpoint%C2%A0has%20a%20higher%20rate%20limit%20than%20the%20unauthenticated%C2%A0v3%20Form%20Submission%20endpoint%2C%20it%20does%20not%20support%20CORS.%20If%20you%27re%20sending%20a%20CORS%20request%2C%20please%20use%20the%20unauthenticated%C2%A0v3%20Form%20Submission%20endpoint%20instead.%C2%A0" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. If you want to use CORS you need to use the &lt;A href="https://legacydocs.hubspot.com/docs/methods/forms/submit_form" target="_blank" rel="noopener"&gt;unauthenticated endpoint&lt;/A&gt; instead.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Oct 2024 11:48:17 GMT</pubDate>
    <dc:creator>TomM2</dc:creator>
    <dc:date>2024-10-22T11:48:17Z</dc:date>
    <item>
      <title>CORS Policy Errors + ServiceWorker Errors</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/CORS-Policy-Errors-ServiceWorker-Errors/m-p/1058407#M77557</link>
      <description>&lt;P&gt;Hello Community,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I’m encountering several issues while trying to implement a quiz form using the HubSpot API on my website. The primary problems revolve around CORS policy errors, ServiceWorker failures, and some preload warnings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;&lt;STRONG&gt;1. CORS Policy Errors:&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;The most critical issue arises when attempting to submit form data via the HubSpot API. The browser blocks the API requests due to CORS restrictions, preventing my website from interacting with the HubSpot form submission endpoint.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Error Messages:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Access &lt;SPAN class=""&gt;to&lt;/SPAN&gt; fetch at &lt;SPAN class=""&gt;'&lt;A href="https://api.hsforms.com/submissions/v3/integration/secure/submit/139531838/fae269ec-390b-4c98-bd5b-bdbab1de8df3" target="_blank" rel="noopener"&gt;https://api.hsforms.com/submissions/v3/integration/secure/submit/139531838/fae269ec-390b-4c98-bd5b-bdbab1de8df3&lt;/A&gt;' from origin '&lt;A href="https://harborx.de" target="_blank" rel="noopener"&gt;https://harborx.de&lt;/A&gt;' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2024-10-22 um 11.55.20.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/129806iC3EFCE38E32FBAB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bildschirmfoto 2024-10-22 um 11.55.20.png" alt="Bildschirmfoto 2024-10-22 um 11.55.20.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2024-10-22 um 11.55.28.png" style="width: 787px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/129807i3CF60D35E774D8F9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bildschirmfoto 2024-10-22 um 11.55.28.png" alt="Bildschirmfoto 2024-10-22 um 11.55.28.png" /&gt;&lt;/span&gt;Cause:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The HubSpot API currently does not allow cross-origin requests from my domain (&lt;A href="https://mywebsite.de" target="_blank" rel="noopener"&gt;https://mywebsite.de&lt;/A&gt;). This results in the browser blocking the submission due to the lack of Access-Control-Allow-Origin headers in the API response.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Impact:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This prevents any form submission from being sent to HubSpot, effectively breaking the user flow in the quiz form where the user inputs details and submits the form.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Potential Solutions Needed:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I need assistance in configuring the HubSpot API to allow CORS for requests coming from &lt;FONT face="Menlo, Monaco, Consolas, Courier New, monospace" color="#c7254e"&gt;&lt;SPAN&gt;my website&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Alternatively, any recommendations on how to implement a server-side proxy to bypass the CORS restrictions would be appreciated.&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;&lt;STRONG&gt;2. ServiceWorker Errors:&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;I’m also encountering several ServiceWorker-related errors, although I haven’t explicitly implemented ServiceWorkers in my code. These errors suggest some issue with how frames are being handled or possibly some interference with HubSpot scripts.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Error Messages:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;serviceWorker.&lt;SPAN class=""&gt;js&lt;/SPAN&gt;:&lt;SPAN class=""&gt;1&lt;/SPAN&gt; &lt;SPAN class=""&gt;Uncaught&lt;/SPAN&gt; (&lt;SPAN class=""&gt;in&lt;/SPAN&gt; promise) &lt;SPAN class=""&gt;Error&lt;/SPAN&gt;: &lt;SPAN class=""&gt;Could&lt;/SPAN&gt; not establish connection. &lt;SPAN class=""&gt;Receiving&lt;/SPAN&gt; end does not exist. serviceWorker.&lt;SPAN class=""&gt;js&lt;/SPAN&gt;:&lt;SPAN class=""&gt;1&lt;/SPAN&gt; &lt;SPAN class=""&gt;Uncaught&lt;/SPAN&gt; (&lt;SPAN class=""&gt;in&lt;/SPAN&gt; promise) &lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;: &lt;SPAN class=""&gt;Failed&lt;/SPAN&gt; to fetch serviceWorker.&lt;SPAN class=""&gt;js&lt;/SPAN&gt;:&lt;SPAN class=""&gt;1&lt;/SPAN&gt; &lt;SPAN class=""&gt;Uncaught&lt;/SPAN&gt; (&lt;SPAN class=""&gt;in&lt;/SPAN&gt; promise) &lt;SPAN class=""&gt;Error&lt;/SPAN&gt;: &lt;SPAN class=""&gt;Frame&lt;/SPAN&gt; &lt;SPAN class=""&gt;with&lt;/SPAN&gt; &lt;SPAN class=""&gt;ID&lt;/SPAN&gt; [some &lt;SPAN class=""&gt;number&lt;/SPAN&gt;] was removed.&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Cause:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;It seems that either a ServiceWorker is trying to manage resources that are no longer available, or it is misconfigured.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Impact:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;These errors could be affecting the smooth functioning of my page and might be causing unwanted delays or failures in handling requests.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Potential Solutions Needed:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Guidance on how to debug and resolve these ServiceWorker-related issues. If HubSpot scripts are using ServiceWorkers, how should I handle them to prevent conflicts or errors?&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 22 Oct 2024 10:03:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/CORS-Policy-Errors-ServiceWorker-Errors/m-p/1058407#M77557</guid>
      <dc:creator>PRoehm</dc:creator>
      <dc:date>2024-10-22T10:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Policy Errors + ServiceWorker Errors</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/CORS-Policy-Errors-ServiceWorker-Errors/m-p/1058462#M77563</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/845582"&gt;@PRoehm&lt;/a&gt;&amp;nbsp; the secure endpoint doesn't support cors at all, you can see this warning in the documentation &lt;A href="https://legacydocs.hubspot.com/docs/methods/forms/submit_form_v3_authentication#:~:text=While%20endpoint%C2%A0has%20a%20higher%20rate%20limit%20than%20the%20unauthenticated%C2%A0v3%20Form%20Submission%20endpoint%2C%20it%20does%20not%20support%20CORS.%20If%20you%27re%20sending%20a%20CORS%20request%2C%20please%20use%20the%20unauthenticated%C2%A0v3%20Form%20Submission%20endpoint%20instead.%C2%A0" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. If you want to use CORS you need to use the &lt;A href="https://legacydocs.hubspot.com/docs/methods/forms/submit_form" target="_blank" rel="noopener"&gt;unauthenticated endpoint&lt;/A&gt; instead.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 11:48:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/CORS-Policy-Errors-ServiceWorker-Errors/m-p/1058462#M77563</guid>
      <dc:creator>TomM2</dc:creator>
      <dc:date>2024-10-22T11:48:17Z</dc:date>
    </item>
  </channel>
</rss>

