<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yegor Chsherbakov</title>
    <description>The latest articles on DEV Community by Yegor Chsherbakov (@yegorckv).</description>
    <link>https://dev.to/yegorckv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2253083%2Fe1b0414b-ef25-4b68-8050-1538c8c41f84.jpg</url>
      <title>DEV Community: Yegor Chsherbakov</title>
      <link>https://dev.to/yegorckv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yegorckv"/>
    <language>en</language>
    <item>
      <title>Ferrum Doesn’t Work on Heroku?</title>
      <dc:creator>Yegor Chsherbakov</dc:creator>
      <pubDate>Tue, 29 Oct 2024 09:50:36 +0000</pubDate>
      <link>https://dev.to/yegorckv/ferrum-doesnt-work-on-heroku-5abm</link>
      <guid>https://dev.to/yegorckv/ferrum-doesnt-work-on-heroku-5abm</guid>
      <description>&lt;p&gt;To work with Ferrum, you need a web driver. Locally, this is simple — a new Chrome window just opens up. But on Heroku, you’ll need to add a buildpack:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;heroku buildpacks:add -i 1 heroku-community/chrome-for-testing&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Don’t forget to set up Chrome in your CI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup Chrome&lt;/span&gt;
    &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;browser-actions/setup-chrome@latest&lt;/span&gt;
    &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;chrome-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s where the problems start: maybe it’s just me, but when generating PDFs with Ferrum, I kept running into a &lt;strong&gt;process_timeout&lt;/strong&gt; error. This error showed up after upgrading to the Heroku &lt;strong&gt;chrome-for-testing&lt;/strong&gt; buildpack.&lt;/p&gt;

&lt;p&gt;The fix — enable the &lt;strong&gt;no-sandbox&lt;/strong&gt; option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Ferrum&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;browser_options: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s1"&gt;'no-sandbox'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ferrum</category>
      <category>pdf</category>
      <category>rails</category>
      <category>heroku</category>
    </item>
    <item>
      <title>Importmap Not Working on iOS</title>
      <dc:creator>Yegor Chsherbakov</dc:creator>
      <pubDate>Tue, 22 Oct 2024 16:47:34 +0000</pubDate>
      <link>https://dev.to/yegorckv/importmap-not-working-on-ios-2jfh</link>
      <guid>https://dev.to/yegorckv/importmap-not-working-on-ios-2jfh</guid>
      <description>&lt;p&gt;I recently encountered an issue where my JavaScript scripts stopped working on iPhones and iPads (tested on Safari, Chrome, and Firefox). The root cause turned out to be the removal of the es-module-shim module in importmaps-rails 2.0, which was responsible for ES module support in older browsers.&lt;/p&gt;

&lt;p&gt;Removing this module breaks the scripts on iOS devices.&lt;/p&gt;

&lt;p&gt;Simple solution: To restore JavaScript functionality, add the following script to your application file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script async src="https://unpkg.com/es-module-shims"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can read more about the removal of the module in the article: &lt;a href="https://world.hey.com/facundo.espinosa/importmaps-rails-2-0-dropped-es-module-shim-2dbd3b19" rel="noopener noreferrer"&gt;world.hey.com/importmaps-rails 2.0 dropped es-module-shim&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>rails</category>
      <category>hotwire</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
