<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Debugging on dev.endevour</title><link>https://devendevour.iankulin.com/tags/debugging/</link><description>Recent content in Debugging on dev.endevour</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Mon, 21 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://devendevour.iankulin.com/tags/debugging/index.xml" rel="self" type="application/rss+xml"/><item><title>npm ERR! Exit handler never called!</title><link>https://devendevour.iankulin.com/npm-err-exit-handler-never-called/</link><pubDate>Mon, 21 Oct 2024 00:00:00 +0000</pubDate><guid>https://devendevour.iankulin.com/npm-err-exit-handler-never-called/</guid><description>&lt;p&gt;I quite like GitHub scanning all my code and sending me security advisories. Here&amp;rsquo;s today&amp;rsquo;s:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devendevour.iankulin.com/images/screen-shot-2024-09-27-at-11.31.03-am.png" alt="" class="img-responsive"&gt; &lt;/p&gt;
&lt;p&gt;With these, and my &lt;a href="https://github.com/dependabot" target="_blank" rel="noopener"&gt;dependabot&lt;/a&gt; alerts, fixing them is usually just a matter of pulling down the project, running an &lt;code&gt;npm update&lt;/code&gt;, building any artifacts, then pushing it back up. But today, not so:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devendevour.iankulin.com/images/screen-shot-2024-09-27-at-11.36.57-am.png" alt="" class="img-responsive"&gt; &lt;/p&gt;
&lt;h3 id="package-lockjson"&gt;package-lock.json&lt;/h3&gt; &lt;p&gt;It&amp;rsquo;s probably worth revisiting what the &lt;code&gt;package-lock.json&lt;/code&gt; does. It contains all the versions of any packages you&amp;rsquo;ve imported, and their dependencies. The idea is that this will make the build reproducible. We don&amp;rsquo;t commit the node_modules folder (that actually contains all that package code), but npm can reproduce it exactly by using the version information in the package-lock.json file. Here&amp;rsquo;s a snippet where you can see all those versions:&lt;/p&gt;</description></item><item><title>Where Do Docker Container Logs Go?</title><link>https://devendevour.iankulin.com/where-do-docker-container-logs-go/</link><pubDate>Sat, 08 Apr 2023 00:00:00 +0000</pubDate><guid>https://devendevour.iankulin.com/where-do-docker-container-logs-go/</guid><description>&lt;p&gt;&lt;img src="https://devendevour.iankulin.com/images/containersfallingoffaship_87726525.jpg" alt="" class="img-responsive"&gt; &lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m still loving the Docker &amp;ldquo;just works&amp;rdquo; magic, despite their &lt;a href="https://www.theregister.com/2023/03/17/docker_free_teams_plan/" target="_blank" rel="noopener"&gt;terrible PR skills&lt;/a&gt; , but sometimes I start a container, then the &lt;code&gt;docker ps -a&lt;/code&gt; shows it exited almost immediately. Clearly I&amp;rsquo;ve made a mistake, but there&amp;rsquo;s no stdout error message to tell me what I&amp;rsquo;ve done wrong, where is it.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s look at an example from today. I&amp;rsquo;m testing &lt;a href="https://filebrowser.org/" target="_blank" rel="noopener"&gt;Filebrowser&lt;/a&gt; on a dev machine before I deploy it to the remote backup machine I&amp;rsquo;m assembling. And instead of following the &lt;a href="https://filebrowser.org/installation" target="_blank" rel="noopener"&gt;official instructions&lt;/a&gt; , I&amp;rsquo;m following a &lt;a href="https://bobcares.com/blog/filebrowser-installation-in-docker/" target="_blank" rel="noopener"&gt;blog post&lt;/a&gt; which has a few more details, but unfortunately also a small error.&lt;/p&gt;</description></item><item><title>rsync episode IV - a sudo hope</title><link>https://devendevour.iankulin.com/rsync-episode-iv-a-sudo-hope/</link><pubDate>Thu, 30 Mar 2023 00:00:00 +0000</pubDate><guid>https://devendevour.iankulin.com/rsync-episode-iv-a-sudo-hope/</guid><description>&lt;p&gt;&lt;img src="https://devendevour.iankulin.com/images/imperialofficersworkingatl_62923535.jpg" alt="" class="img-responsive"&gt; &lt;/p&gt;
&lt;p&gt;With all those earlier rsync bumps out of the way, I was ready to try my first rsync backup at the command line to sync my movies directory on the NAS to a (NTFS formatted) USB drive plugged into the same NAS. This is to be one of the simplest since there&amp;rsquo;s no remote server involved, just copying from mount point directory to another - so no drama with remote permissions.&lt;/p&gt;</description></item><item><title>Expired Packages Part II</title><link>https://devendevour.iankulin.com/expired-packages-part-ii/</link><pubDate>Tue, 31 Jan 2023 00:00:00 +0000</pubDate><guid>https://devendevour.iankulin.com/expired-packages-part-ii/</guid><description>&lt;p&gt;Following on from the previous post&amp;hellip;&lt;/p&gt;
&lt;p&gt;I went the nuclear route - deleted the node_modules folder, package-lock.json and installed the packages from packages.json. I still had some errors, but the react app at least ran correctly. Also, the messages are a bit more intelligible, and all of them cascade from this one.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# npm audit report

nth-check &amp;lt;2.0.1
Severity: high
Inefficient Regular Expression Complexity in nth-check - https://github.com/advisories/GHSA-rp65-9cf3-cjxr
fix available via `npm audit fix --force`
Will install react-scripts@2.1.3, which is a breaking change
node_modules/svgo/node_modules/nth-check
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;From my, admittedly ignorant, viewpoint, there&amp;rsquo;s a couple of weird things going on here.&lt;/p&gt;</description></item><item><title>Something weird 'append</title><link>https://devendevour.iankulin.com/something-weird-about-append/</link><pubDate>Mon, 21 Nov 2022 00:00:00 +0000</pubDate><guid>https://devendevour.iankulin.com/something-weird-about-append/</guid><description>&lt;p&gt;I&amp;rsquo;m noodling around making sure I understand how Core Data works. Thought I&amp;rsquo;d start with a master/detail app with an array of structs, then replicate it in a Core Data implementation. I&amp;rsquo;m using an array of this struct for my data:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;struct Garden {
 var id = UUID()
 var name = &amp;#34;&amp;#34;
 var address = &amp;#34;&amp;#34;
 var plants: [Plant] = []
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And I thought this code to load up some sample data was pretty sweet.&lt;/p&gt;</description></item><item><title>Clean Build Folder</title><link>https://devendevour.iankulin.com/clean-build-folder/</link><pubDate>Thu, 17 Nov 2022 00:00:00 +0000</pubDate><guid>https://devendevour.iankulin.com/clean-build-folder/</guid><description>&lt;p&gt;Working on adding Core Data to the FriendFace app, and burnt up 20 minutes figuring out a bug. To set the scene, all I&amp;rsquo;ve changed in the app is to add a couple of core data entities. The plan is that when the JSON is fetched, and decoded into the objects, a copy of the graph will be persisted.&lt;/p&gt;
&lt;p&gt;Problem One was that I was getting a build errors saying the core data classes had been re-declared, and others saying that my class name was ambiguous. Since XCode had generated this code when I&amp;rsquo;d told it to &amp;ldquo;Create NSManagedObject subclass&amp;rdquo;. This is what you do when you want to be able to edit the NSManagedObject for example to created computed properties to unwrap the real properties. If you don&amp;rsquo;t need that flexibility, you just leave the default setting in the entity for XCode to create internally.&lt;/p&gt;</description></item><item><title>You need to enjoy puzzles</title><link>https://devendevour.iankulin.com/you-need-to-enjoy-puzzles/</link><pubDate>Sat, 22 Oct 2022 00:00:00 +0000</pubDate><guid>https://devendevour.iankulin.com/you-need-to-enjoy-puzzles/</guid><description>&lt;p&gt;&lt;img src="https://devendevour.iankulin.com/images/frustration.jpg" alt="frustrated worker, painting - Stable Diffusion" class="img-responsive"&gt; &lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m writing the Habits &lt;a href="https://devendevour.iankulin.com/list-apps/"&gt;list based app&lt;/a&gt; from #100Days and had a working MVP, then for some reason, decided to refactor by changing the subview I&amp;rsquo;d written as a function, into a struct. Some time later, I discovered that my list items were not updating correctly, so detective time.&lt;/p&gt;
&lt;p&gt;I talked a little bit about the architecture yesterday - the item is a struct, and there&amp;rsquo;s a class containing an array of the items. Something like this:&lt;/p&gt;</description></item><item><title>iExpense Feedback</title><link>https://devendevour.iankulin.com/iexpense-feedback/</link><pubDate>Wed, 12 Oct 2022 00:00:00 +0000</pubDate><guid>https://devendevour.iankulin.com/iexpense-feedback/</guid><description>&lt;p&gt;I finally got around to looking at Paul&amp;rsquo;s solutions for the &lt;a href="https://devendevour.iankulin.com/iexpense-challenges/"&gt;iExpense challenges&lt;/a&gt; .&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Use the user’s preferred currency, rather than always using US dollars.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Same approach as me,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;.currency(code: Locale.current.currency?.identifier ?? &amp;quot;USD&amp;quot;)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;except that he does the work in a local variable which is a bit neater. Since it appears in two places - the display view and the view for adding an expense, this would mean duplicating it, making it global (not rare for user default type settings) or passing it down through the view hierarchy. I feel either of the first two options are fine for this project, but Paul is thorough and extends the FormatStyle protocol, only for currency, to have a new computed property .localcurrency - which is a great solution.&lt;/p&gt;</description></item></channel></rss>