title: Rails 7 accessing pinned libraries
body: <p><code>importmap.rb</code> includes</p>
  <pre><code>pin &quot;javascript-autocomplete&quot;, to: &quot;https://ga.jspm.io/npm:javascript-autocomplete@1.0.5/auto-complete.js&quot;
  </code></pre>
  <p>And, following the rails guides, <code>application.js</code> was amended with</p>
  <pre><code>import &quot;javascript-autocomplete&quot;
  </code></pre>
  <p>although uncertainty about the syntax remains. Also attempted, as the script defines <code>var autoComplete</code> was</p>
  <pre><code>import autoComplete from &quot;javascript-autocomplete&quot;
  </code></pre>
  <p>in either instance, while the header shows:</p>
  <pre><code>&lt;script type=&quot;importmap&quot; data-turbo-track=&quot;reload&quot;&gt;{
    &quot;imports&quot;: {
      &quot;application&quot;: &quot;/assets/application-333b944449a4c540424142c36f01f97feebd58f2f41d10565ecfde32cb315110.js&quot;,
      &quot;@hotwired/turbo-rails&quot;: &quot;/assets/turbo.min-e5023178542f05fc063cd1dc5865457259cc01f3fba76a28454060d33de6f429.js&quot;,
      &quot;@hotwired/stimulus&quot;: &quot;/assets/stimulus.min-900648768bd96f3faeba359cf33c1bd01ca424ca4d2d05f36a5d8345112ae93c.js&quot;,
      &quot;@hotwired/stimulus-loading&quot;: &quot;/assets/stimulus-loading-1fc59770fb1654500044afd3f5f6d7d00800e5be36746d55b94a2963a7a228aa.js&quot;,
      &quot;javascript-autocomplete&quot;: &quot;https://ga.jspm.io/npm:javascript-autocomplete@1.0.5/auto-complete.js&quot;,
      [...]
    }
  </code></pre>
  <p>the body has</p>
  <pre><code>&lt;%= javascript_tag do %&gt;
    var demo1 = new autoComplete({
      [...]
    });
  &lt;% end %&gt;
  </code></pre>
  <p>which fails to run:  <code>Uncaught ReferenceError: autoComplete is not defined</code>
  so the script is not being accessed.</p>
  <p>So where is this lacking?</p>