<?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 Trying to switch to ES from AMD - Uncaught TypeError: Failed to resolve module specifier &amp;quot;@esri/arcgis-html-sanitizer&amp;quot;. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109186#M75033</link>
    <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;I hoped I wouldn't have to post this - but my thinking is coming up with zero and Google only produces a single result (Github of "@esri/arcgis-html-sanitizer").&lt;/P&gt;&lt;P&gt;I'm trying to modernize my current AMD code to ES modules however I can't get past the initial import X from "X" stage.&lt;/P&gt;&lt;P&gt;It seems that certain imports cause the following error to occur: &lt;STRONG&gt;"Uncaught TypeError: Failed to resolve module specifier "@esri/arcgis-html-sanitizer"."&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So far I've found the following imports: MapView and IdentityManager trigger the error so far.&lt;/P&gt;&lt;P&gt;The only result on Google points me to:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-html-sanitizer" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-html-sanitizer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So I install "@esri/arcgis-html-sanitizer" and attempt to import the above, above my MapView/IdentityManager imports using the following:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;import {&lt;/SPAN&gt; &lt;SPAN&gt;Sanitizer }&lt;/SPAN&gt; &lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;"/node_modules/@esri/arcgis-html-sanitizer/dist/umd/arcgis-html-sanitizer.min.js"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;In my understanding it should be pointing to a .js file, like the other imports but there isn't one in the main directory and I've tried pointing it to every single version available in the dist subfolders.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Obviously it gives me a 404 error when I try and point to the "@esri/arcgis-html-sanitizer directory itself and all other iterations give me the following:&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;"Uncaught TypeError: Failed to resolve module specifier "@esri/arcgis-html-sanitizer". Relative references must start with either "/", "./", or "../"." - I know this means I'm not pointing to it correctly, but I can't work out what I'm supposed to be pointing to.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can someone put me out of my misery?&lt;/DIV&gt;</description>
    <pubDate>Wed, 20 Oct 2021 13:29:29 GMT</pubDate>
    <dc:creator>LukeCalladine</dc:creator>
    <dc:date>2021-10-20T13:29:29Z</dc:date>
    <item>
      <title>Trying to switch to ES from AMD - Uncaught TypeError: Failed to resolve module specifier "@esri/arcgis-html-sanitizer".</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109186#M75033</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;I hoped I wouldn't have to post this - but my thinking is coming up with zero and Google only produces a single result (Github of "@esri/arcgis-html-sanitizer").&lt;/P&gt;&lt;P&gt;I'm trying to modernize my current AMD code to ES modules however I can't get past the initial import X from "X" stage.&lt;/P&gt;&lt;P&gt;It seems that certain imports cause the following error to occur: &lt;STRONG&gt;"Uncaught TypeError: Failed to resolve module specifier "@esri/arcgis-html-sanitizer"."&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So far I've found the following imports: MapView and IdentityManager trigger the error so far.&lt;/P&gt;&lt;P&gt;The only result on Google points me to:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-html-sanitizer" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-html-sanitizer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So I install "@esri/arcgis-html-sanitizer" and attempt to import the above, above my MapView/IdentityManager imports using the following:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;import {&lt;/SPAN&gt; &lt;SPAN&gt;Sanitizer }&lt;/SPAN&gt; &lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;"/node_modules/@esri/arcgis-html-sanitizer/dist/umd/arcgis-html-sanitizer.min.js"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;In my understanding it should be pointing to a .js file, like the other imports but there isn't one in the main directory and I've tried pointing it to every single version available in the dist subfolders.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Obviously it gives me a 404 error when I try and point to the "@esri/arcgis-html-sanitizer directory itself and all other iterations give me the following:&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;"Uncaught TypeError: Failed to resolve module specifier "@esri/arcgis-html-sanitizer". Relative references must start with either "/", "./", or "../"." - I know this means I'm not pointing to it correctly, but I can't work out what I'm supposed to be pointing to.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can someone put me out of my misery?&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Oct 2021 13:29:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109186#M75033</guid>
      <dc:creator>LukeCalladine</dc:creator>
      <dc:date>2021-10-20T13:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to switch to ES from AMD - Uncaught TypeError: Failed to resolve module specifier "@esri/arcgis-html-sanitizer".</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109231#M75037</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/283137"&gt;@LukeCalladine&lt;/a&gt; this sounds like a configuration issue with your module bundler. Do you have a github repo with a simple app that reproduces the issue? Or you can try to reproduce it with one of our sample apps: &lt;A href="https://github.com/Esri/jsapi-resources/tree/master/esm-samples" target="_blank"&gt;https://github.com/Esri/jsapi-resources/tree/master/esm-samples&lt;/A&gt;. Maybe comparing against our samples will provide some hints.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 14:44:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109231#M75037</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-10-20T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to switch to ES from AMD - Uncaught TypeError: Failed to resolve module specifier "@esri/arcgis-html-sanitizer".</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109320#M75041</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Many thanks for your reply - I can only imagine the fact I don't know what a module bundler is, is probably the root of my current problem and likely the majority of my future ones!&lt;/P&gt;&lt;P&gt;I've just cloned the jsapi-node ESM sample and was able to import MapView somewhat successfully - while I get a HTMLElement error which I have no idea to fix yet, it does seem to have gotten past the initial Import error I was getting in my initial post. I'll take a look through the files and see if I can get my head around what's happening.&lt;/P&gt;&lt;P&gt;And to think I thought I was getting the hang of this yesterday...&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 16:10:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109320#M75041</guid>
      <dc:creator>LukeCalladine</dc:creator>
      <dc:date>2021-10-20T16:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to switch to ES from AMD - Uncaught TypeError: Failed to resolve module specifier "@esri/arcgis-html-sanitizer".</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109378#M75043</link>
      <description>&lt;P&gt;Turns out I may not need to learn too much about module bundlers!&lt;/P&gt;&lt;P&gt;I was able to get ViteJS to do it all for me first time, after watching &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;'s video on ViteJS on Youtube: &lt;A href="https://www.youtube.com/watch?v=sV1Tcie2SR8" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=sV1Tcie2SR8&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 18:42:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-switch-to-es-from-amd-uncaught-typeerror/m-p/1109378#M75043</guid>
      <dc:creator>LukeCalladine</dc:creator>
      <dc:date>2021-10-20T18:42:14Z</dc:date>
    </item>
  </channel>
</rss>

