<?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: Module parse failed: Identifier 'e' has already been declared in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126705#M75615</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/546228"&gt;@naveenanne&lt;/a&gt;&amp;nbsp;This looks like an issue with one of your other libraries, the file path listed in the error message isn't coming from the ArcGIS API for JavaScript.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Dec 2021 15:44:26 GMT</pubDate>
    <dc:creator>AndyGup</dc:creator>
    <dc:date>2021-12-16T15:44:26Z</dc:date>
    <item>
      <title>Module parse failed: Identifier 'e' has already been declared</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126586#M75612</link>
      <description>&lt;P&gt;I'm building a reusable component.&amp;nbsp;The component uses @arcgis/core along with other ui.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm able to install and use my library in any react application, when I try to build the react app I'm getting the below error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;./node_modules/@jlibrary/mapbuildtest/dist/index-fc2c8712.js 69378:9
Module parse failed: Identifier 'e' has already been declared (69378:9)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| };
| 
&amp;gt; for (var e = 48; e &amp;lt; 58; e++) {
|   L0[e] = String.fromCharCode(e);
| }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 07:56:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126586#M75612</guid>
      <dc:creator>naveenanne</dc:creator>
      <dc:date>2021-12-16T07:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Module parse failed: Identifier 'e' has already been declared</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126705#M75615</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/546228"&gt;@naveenanne&lt;/a&gt;&amp;nbsp;This looks like an issue with one of your other libraries, the file path listed in the error message isn't coming from the ArcGIS API for JavaScript.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 15:44:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126705#M75615</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-12-16T15:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Module parse failed: Identifier 'e' has already been declared</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126833#M75622</link>
      <description>&lt;P&gt;In my library, I just have one component&lt;/P&gt;&lt;P&gt;MapTest.js&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import React, { useRef, useEffect } from "react";
import MapView from "@arcgis/core/views/MapView";
import Map from "@arcgis/core/Map";

function MapTest() {
    const _mapDiv = useRef(null);
    useEffect(() =&amp;gt; {
        if (_mapDiv.current) {
            const _view = new MapView({
                container: _mapDiv.current,
                map: new Map({
                    basemap: "topo-vector"
                })
            });
        }
    }, []);

    return &amp;lt;div className="mapDiv" ref={_mapDiv}&amp;gt;&amp;lt;/div&amp;gt;;
}

export default MapTest;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rollup.config.js&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import babel from "@rollup/plugin-babel";
import resolve from "@rollup/plugin-node-resolve";
import external from "rollup-plugin-peer-deps-external";
import postcss from "rollup-plugin-postcss";
import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser";

const devEnvironmentPlugins = [
  external(),
  postcss({ plugins: [], minimize: true }),
  babel({ exclude: "node_modules/**", presets: ["@babel/preset-react"] }),
  external(),
  resolve(),
  commonjs(),
  terser(),
];

const config = [
  {
    input: "src/index.js",
    output: [
      {
        dir: "dist/js",
        format: "cjs",
        sourcemap: true,
      },
    ],
    plugins: devEnvironmentPlugins,
    external: ["react", "react-dom", "prop-types", "styled-components"],
  },
  {
    input: "src/index.js",
    output: [
      {
        dir: "dist/js",
        format: "es",
        sourcemap: true,
      },
    ],
    plugins: devEnvironmentPlugins,
    external: ["react", "react-dom", "prop-types", "styled-components"],
  },
];

export default config;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my react application I'm consuming the library&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import React from "react";
import { MapTest } from "@dltest/mapbuildtest";
import "./App.css";

function App() {
  return &amp;lt;div id="root"&amp;gt;&amp;lt;MapTest /&amp;gt;&amp;lt;/div&amp;gt;;
}

export default App;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error that comes is&lt;/P&gt;&lt;LI-CODE lang="c"&gt;./node_modules/@dltest/mapbuildtest/dist/index-0ae0a047.js 64268:9
Module parse failed: Identifier 'e' has already been declared (64268:9)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| };
| 
&amp;gt; for (var e = 48; e &amp;lt; 58; e++) {
|   qJ[e] = String.fromCharCode(e);
| }&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 16 Dec 2021 18:27:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126833#M75622</guid>
      <dc:creator>naveenanneufl</dc:creator>
      <dc:date>2021-12-16T18:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Module parse failed: Identifier 'e' has already been declared</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126890#M75624</link>
      <description>&lt;P&gt;Okay, thanks. Taking another look at those two error messages, this seems to be a ES6-to-ES5 transpilation error. That's typically a configuration issue with your framework/bundler and not an issue with the ArcGIS JS API.&lt;/P&gt;&lt;P&gt;I'm basing my guess on one instance of a similar code signature that is in my local install&amp;nbsp; /node_modules/@arcgis/core/views/input/keys.js. I've installed @arcgis/core@4.22. and that module is using ES6+ syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for(let s=48;s&amp;lt;58;s++)o[s]=String.fromCharCode(s);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try building your component using our example as a base and let us know if that works? &lt;A href="https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app" target="_blank" rel="noopener"&gt;https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 20:20:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126890#M75624</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-12-16T20:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Module parse failed: Identifier 'e' has already been declared</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126952#M75625</link>
      <description>&lt;P&gt;The below browserlist config within consuming application solved the build issues. I'll confirm in a while after deployment is successful.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"browserslist": {
    "production": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 21:50:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/module-parse-failed-identifier-e-has-already-been/m-p/1126952#M75625</guid>
      <dc:creator>naveenanneufl</dc:creator>
      <dc:date>2021-12-16T21:50:46Z</dc:date>
    </item>
  </channel>
</rss>

