<?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 esriRequest returning error in test file in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esrirequest-returning-error-in-test-file/m-p/1323826#M82106</link>
    <description>&lt;P&gt;I'm currently facing an issue when trying to run my tests in my vue3 project, the fetch is running normally without any issues but the tests are failing for unknown reason, I have found a similar issue but I'm using a different version than that:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-is-esrirequest-not-working/td-p/623384" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-is-esrirequest-not-working/td-p/623384&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Current lib versions:&lt;BR /&gt;vue: v&lt;SPAN&gt;3.2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core v4.27.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;vitest v0.24.3&lt;BR /&gt;&lt;BR /&gt;This is my function which I'm getting the error from:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  const fetchAddressReverse = async (lng, lat) =&amp;gt; {
    const apiRequest = await esriRequest(searchApiCredentials.esriSearchUrl, {
      query: {
        token: directionsApiCredentials.esriToken,
        f: 'json',
        location: `${lat},${lng}`,
      },
    })
    if (!apiRequest || !apiRequest.data?.address || !apiRequest.data.address?.LongLabel) return null
    return transformAddress(apiRequest.data.address?.LongLabel)
  }&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And when I run my tests I'm getting this error:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: Right-hand side of 'instanceof' is not an object
 ❯ K node_modules/@arcgis/core/request.js:5:3388
 ❯ V node_modules/@arcgis/core/request.js:5:8091
 ❯ Proxy.j node_modules/@arcgis/core/request.js:5:2032
 ❯ Object.fetchAddressReverse src/service/external/geo/useGeoService.ts:84:23
     82|    */
     83|   const fetchAddressReverse = async (lng, lat) =&amp;gt; {
     84|     const apiRequest = await esriRequest(searchApiCredentials.esriSearchUrl, {
       |                       ^
     85|       query: {
     86|         token: directionsApiCredentials.esriToken,&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2023 10:54:16 GMT</pubDate>
    <dc:creator>HamzaAmdouni</dc:creator>
    <dc:date>2023-08-30T10:54:16Z</dc:date>
    <item>
      <title>esriRequest returning error in test file</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esrirequest-returning-error-in-test-file/m-p/1323826#M82106</link>
      <description>&lt;P&gt;I'm currently facing an issue when trying to run my tests in my vue3 project, the fetch is running normally without any issues but the tests are failing for unknown reason, I have found a similar issue but I'm using a different version than that:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-is-esrirequest-not-working/td-p/623384" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-is-esrirequest-not-working/td-p/623384&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Current lib versions:&lt;BR /&gt;vue: v&lt;SPAN&gt;3.2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core v4.27.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;vitest v0.24.3&lt;BR /&gt;&lt;BR /&gt;This is my function which I'm getting the error from:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  const fetchAddressReverse = async (lng, lat) =&amp;gt; {
    const apiRequest = await esriRequest(searchApiCredentials.esriSearchUrl, {
      query: {
        token: directionsApiCredentials.esriToken,
        f: 'json',
        location: `${lat},${lng}`,
      },
    })
    if (!apiRequest || !apiRequest.data?.address || !apiRequest.data.address?.LongLabel) return null
    return transformAddress(apiRequest.data.address?.LongLabel)
  }&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And when I run my tests I'm getting this error:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: Right-hand side of 'instanceof' is not an object
 ❯ K node_modules/@arcgis/core/request.js:5:3388
 ❯ V node_modules/@arcgis/core/request.js:5:8091
 ❯ Proxy.j node_modules/@arcgis/core/request.js:5:2032
 ❯ Object.fetchAddressReverse src/service/external/geo/useGeoService.ts:84:23
     82|    */
     83|   const fetchAddressReverse = async (lng, lat) =&amp;gt; {
     84|     const apiRequest = await esriRequest(searchApiCredentials.esriSearchUrl, {
       |                       ^
     85|       query: {
     86|         token: directionsApiCredentials.esriToken,&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 10:54:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esrirequest-returning-error-in-test-file/m-p/1323826#M82106</guid>
      <dc:creator>HamzaAmdouni</dc:creator>
      <dc:date>2023-08-30T10:54:16Z</dc:date>
    </item>
  </channel>
</rss>

