<?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 ES Modules: '@arcgis/core/geometry/projection' does not contain a default export' in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/es-modules-arcgis-core-geometry-projection-does/m-p/1051314#M72736</link>
    <description>&lt;P&gt;I am testing out the new ES Modules option in 4.19 by migrating one of my apps from ESRI Loader to ES Modules. The app uses React and was created using Create React App.&lt;/P&gt;&lt;P&gt;I am having issues importing the "projection" module. For example if I try to import it as below I get a compile time error:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import projection from "@arcgis/core/geometry/projection";

// Failed to compile.
// ./src/map/MainMap.tsx
// Attempted import error: '@arcgis/core/geometry/projection' does not contain a default export (imported as 'projection').&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additional version info:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"@arcgis/core"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^4.19.1"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"react"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^17.0.0"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"react-scripts"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"4.0.3"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"typescript"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^3.7.5"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I import this module?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Apr 2021 14:39:43 GMT</pubDate>
    <dc:creator>JamesGough</dc:creator>
    <dc:date>2021-04-26T14:39:43Z</dc:date>
    <item>
      <title>ES Modules: '@arcgis/core/geometry/projection' does not contain a default export'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/es-modules-arcgis-core-geometry-projection-does/m-p/1051314#M72736</link>
      <description>&lt;P&gt;I am testing out the new ES Modules option in 4.19 by migrating one of my apps from ESRI Loader to ES Modules. The app uses React and was created using Create React App.&lt;/P&gt;&lt;P&gt;I am having issues importing the "projection" module. For example if I try to import it as below I get a compile time error:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import projection from "@arcgis/core/geometry/projection";

// Failed to compile.
// ./src/map/MainMap.tsx
// Attempted import error: '@arcgis/core/geometry/projection' does not contain a default export (imported as 'projection').&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additional version info:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"@arcgis/core"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^4.19.1"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"react"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^17.0.0"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"react-scripts"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"4.0.3"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"typescript"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"^3.7.5"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I import this module?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 14:39:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/es-modules-arcgis-core-geometry-projection-does/m-p/1051314#M72736</guid>
      <dc:creator>JamesGough</dc:creator>
      <dc:date>2021-04-26T14:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: ES Modules: '@arcgis/core/geometry/projection' does not contain a default export'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/es-modules-arcgis-core-geometry-projection-does/m-p/1051354#M72738</link>
      <description>&lt;P&gt;The syntax would look like this.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { load, project } from '@arcgis/core/geometry/projection';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could import the entire module like this.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import * as projection from '@arcgis/core/geometry/projection';&lt;/LI-CODE&gt;&lt;P&gt;However this will load all the methods of projection, even if you don't use them. It's a minimal impact on built javascript, but the first way allows build tools to only include code you use.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:31:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/es-modules-arcgis-core-geometry-projection-does/m-p/1051354#M72738</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-04-26T15:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: ES Modules: '@arcgis/core/geometry/projection' does not contain a default export'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/es-modules-arcgis-core-geometry-projection-does/m-p/1051365#M72741</link>
      <description>&lt;P&gt;Perfect, thanks Rene!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:44:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/es-modules-arcgis-core-geometry-projection-does/m-p/1051365#M72741</guid>
      <dc:creator>JamesGough</dc:creator>
      <dc:date>2021-04-26T15:44:04Z</dc:date>
    </item>
  </channel>
</rss>

