<?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: Error when using dojo/text! in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-using-dojo-text/m-p/1311792#M81772</link>
    <description>&lt;P&gt;A lot has changed in those releases, including the &lt;A href="https://developers.arcgis.com/javascript/latest/4.20/#downloads" target="_self"&gt;removal of dojo&lt;/A&gt; as part of the API in 4.20.&amp;nbsp; I don't remember the technical specifics of what transpired, but I ended up making my own custom replacement for the text module.&amp;nbsp; It's called text.js, and I placed it within the root of my own package.&amp;nbsp; The implementation is very simple:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;define([], function() {
	return {
		load: function(id, require, callback) {
			var url = require.toUrl(id);
			var prop = "url:" + url;
			var cacheVal = require.cache[prop];

			if (typeof cacheVal == "string")
				callback(cacheVal);
			else {
				fetch(require.toUrl(id), {credentials:"include"}).then(function(response) {
					response.text().then(function(text) {
						require.cache[prop] = text;

						callback(text);
					});
				});
			}
		}
	};
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So then,&amp;nbsp;if you put this text.js file directly in the directory represented by "cuwcd", your function call would change to:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require(["cuwcd/text!cuwcd/widgets/Header/header.hbs"], function(hbs) {
	//etc
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2023 22:02:39 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-07-25T22:02:39Z</dc:date>
    <item>
      <title>Error when using dojo/text!</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-using-dojo-text/m-p/1311780#M81770</link>
      <description>&lt;P&gt;I'm getting an error when trying to upgrade from version 4.17 to 4.27:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Loading failed for the &amp;lt;script&amp;gt; with source “&lt;A title="https://js.arcgis.com/4.27/dojo/text.js" href="https://js.arcgis.com/4.27/dojo/text.js" target="_blank" rel="noopener noreferrer"&gt;https://js.arcgis.com/4.27/dojo/text.js&lt;/A&gt;”.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I've narrowed down (I believe) the issue to using the "dojo/text!" in order to pull in text files. Did something change to cause this issue and is there a work around that I can use?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;script&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;require&lt;/SPAN&gt;&lt;SPAN&gt;([&lt;/SPAN&gt;&lt;SPAN&gt;'dojo/text!cuwcd/widgets/Header/header.hbs'&lt;/SPAN&gt;&lt;SPAN&gt;], &lt;/SPAN&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;hbs&lt;/SPAN&gt;&lt;SPAN&gt;) {});&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;script&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Jul 2023 21:05:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-using-dojo-text/m-p/1311780#M81770</guid>
      <dc:creator>GBreen</dc:creator>
      <dc:date>2023-07-25T21:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using dojo/text!</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-using-dojo-text/m-p/1311791#M81771</link>
      <description>&lt;P&gt;All non-Esri packages, including Dojo related packages, are no longer part of the released CDN builds. The old versions are still there though and can be configured for use. See the notes here.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/4.25/#removal-of-non-esri-packages-from-cdn" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/4.25/#removal-of-non-esri-packages-from-cdn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 22:02:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-using-dojo-text/m-p/1311791#M81771</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-07-25T22:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using dojo/text!</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-using-dojo-text/m-p/1311792#M81772</link>
      <description>&lt;P&gt;A lot has changed in those releases, including the &lt;A href="https://developers.arcgis.com/javascript/latest/4.20/#downloads" target="_self"&gt;removal of dojo&lt;/A&gt; as part of the API in 4.20.&amp;nbsp; I don't remember the technical specifics of what transpired, but I ended up making my own custom replacement for the text module.&amp;nbsp; It's called text.js, and I placed it within the root of my own package.&amp;nbsp; The implementation is very simple:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;define([], function() {
	return {
		load: function(id, require, callback) {
			var url = require.toUrl(id);
			var prop = "url:" + url;
			var cacheVal = require.cache[prop];

			if (typeof cacheVal == "string")
				callback(cacheVal);
			else {
				fetch(require.toUrl(id), {credentials:"include"}).then(function(response) {
					response.text().then(function(text) {
						require.cache[prop] = text;

						callback(text);
					});
				});
			}
		}
	};
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So then,&amp;nbsp;if you put this text.js file directly in the directory represented by "cuwcd", your function call would change to:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require(["cuwcd/text!cuwcd/widgets/Header/header.hbs"], function(hbs) {
	//etc
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 22:02:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-using-dojo-text/m-p/1311792#M81772</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-07-25T22:02:39Z</dc:date>
    </item>
  </channel>
</rss>

