<?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: Jest encountered an unexpected token, SDK 4.32, React 18 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jest-encountered-an-unexpected-token-sdk-4-32/m-p/1623747#M87254</link>
    <description>&lt;P&gt;CRA is fairly old and is now marked as depreciated so you may want to consider using a different framework such as vite.&lt;BR /&gt;&lt;BR /&gt;That said to get different babel configs working in CRA you'll likely need to 'eject' CRA which will allow you to manage all the config of your project. Note once you've ejected you can not go back.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jun 2025 01:05:31 GMT</pubDate>
    <dc:creator>JamesIng</dc:creator>
    <dc:date>2025-06-16T01:05:31Z</dc:date>
    <item>
      <title>Jest encountered an unexpected token, SDK 4.32, React 18</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jest-encountered-an-unexpected-token-sdk-4-32/m-p/1621218#M87232</link>
      <description>&lt;P&gt;I have added &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/maps-components-react 4.32.14 to our React 18.3.1 project. I am having issues running Jest tests on the new component.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clu_yo_2-1749138776477.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/133847i2BA938E924B89285/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clu_yo_2-1749138776477.png" alt="clu_yo_2-1749138776477.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Static class blocks are not enabled. Please add `@babel/plugin-transform-class-static-block` to your configuration&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clu_yo_3-1749138803963.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/133848i06093DCD0A4282FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clu_yo_3-1749138803963.png" alt="clu_yo_3-1749138803963.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clu_yo_4-1749138823679.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/133849iA877458463FC8FB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clu_yo_4-1749138823679.png" alt="clu_yo_4-1749138823679.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This error is saying that&amp;nbsp;@babel/plugin-transform-class-static-block is not enabled. But that package is included in&amp;nbsp;&lt;SPAN&gt;'@babel/preset-env'&lt;/SPAN&gt;&lt;A href="https://babeljs.io/docs/babel-plugin-transform-class-static-block" target="_self"&gt; (babel-plugin-transform-class-static-block&lt;/A&gt;&amp;nbsp;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I went ahead and tried to install it separately as a dev dependency anyway and add static block to the babel.config.js below:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;module.exports = {
  presets: [
    ['@babel/preset-env', { targets: { node: 'current' } }],
    '@babel/preset-react'
  ],
  plugins: [
    '@babel/plugin-transform-class-static-block',
    '@babel/plugin-transform-class-properties'
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The project adds configurations through the script/cli options:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"react-scripts test --silent --coverage --setupFilesAfterEnv='./src/.setupTests.js' --transformIgnorePatterns \"node_modules/(?!(@arcgis|@esri/calcite-components|@stencil/core|primereact|primeicons|primeflex|axios)/)\""&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 16:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jest-encountered-an-unexpected-token-sdk-4-32/m-p/1621218#M87232</guid>
      <dc:creator>clu_yo</dc:creator>
      <dc:date>2025-06-05T16:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Jest encountered an unexpected token, SDK 4.32, React 18</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jest-encountered-an-unexpected-token-sdk-4-32/m-p/1621364#M87233</link>
      <description>&lt;P&gt;The babel.config.js file is doing nothing. Since the project is a CRA, the project will not read external config files. It is all managed by CRA.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;CRA includes&amp;nbsp;@babel/preset-env, which itself contains&amp;nbsp;"@babel/plugin-transform-class-static-block": "^7.27.1". Not sure then how I am suppose to add class static blocks to a config file if it is supposed to already be included and I can't edit the config file of a CRA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 20:58:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jest-encountered-an-unexpected-token-sdk-4-32/m-p/1621364#M87233</guid>
      <dc:creator>clu_yo</dc:creator>
      <dc:date>2025-06-05T20:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Jest encountered an unexpected token, SDK 4.32, React 18</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jest-encountered-an-unexpected-token-sdk-4-32/m-p/1623747#M87254</link>
      <description>&lt;P&gt;CRA is fairly old and is now marked as depreciated so you may want to consider using a different framework such as vite.&lt;BR /&gt;&lt;BR /&gt;That said to get different babel configs working in CRA you'll likely need to 'eject' CRA which will allow you to manage all the config of your project. Note once you've ejected you can not go back.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 01:05:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jest-encountered-an-unexpected-token-sdk-4-32/m-p/1623747#M87254</guid>
      <dc:creator>JamesIng</dc:creator>
      <dc:date>2025-06-16T01:05:31Z</dc:date>
    </item>
  </channel>
</rss>

