Casey Primozic’s Notes

Misc. notes, code, and other content I want to post publicly that don’t warrant a full blog post

By Casey Primozic

Subscribe to RSS

A Basic Graphviz Dark Theme Config

I regularly use Graphviz to generate… graph visualizations. Since my website and blog are all dark-themed, I usually want to set it up so that the generated SVG is dark-themed as well. Here’s the basic config I use to make graphviz produce outputs with dark backgrounds and light content: digraph G { bgcolor="#181818"; node [ fontcolor = "#e6e6e6", style = filled, color = "#e6e6e6", fillcolor = "#333333" ] edge [ color = "#e6e6e6", fontcolor = "#e6e6e6" ] # The rest of your code goes here.
Read more →

Fixing regl Error Invalid Dynamic Attribute

Recently when working with the regl WebGL wrapper library, I encountered a weird error that I didn’t understand the cause of: (regl) invalid dynamic attribute "position" in command I checked my code, and I was indeed passing a position attribute and the data array I was using to construct the buffer looked correct. The error also happened intermittently, happening after my application hot-reloaded. The Cause It turns out that I had accidentally created two regl instances and was trying to use buffers allocated on one with commands created on a different one.
Read more →

Fixing Sveltekit Failed to Load URL SERVER/internal.js

I was working on a new SvelteKit project with Svelte 5 recently, and I kept getting an error that prevented anything from loading in the browser: [vite] Pre-transform error: Failed to load url __SERVER__/internal.js (resolved id: /Users/casey/osu-embeddings/frontend/.svelte-kit/generated/server/internal.js) in /Users/casey/osu-embeddings/frontend/node_modules/@sveltejs/kit/src/runtime/server/index.js. Does the file exist? [vite] Error when evaluating SSR module /node_modules/@sveltejs/kit/src/runtime/server/index.js: failed to import "__SERVER__/internal.js" |- Error: Cannot find module '__SERVER__/internal.js' imported from '/Users/casey/osu-embeddings/frontend/node_modules/@sveltejs/kit/src/runtime/server/index.js' at nodeImport (file:///Users/casey/osu-embeddings/frontend/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:55067:25) at ssrImport (file:///Users/casey/osu-embeddings/frontend/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:54976:30) at eval (/Users/casey/osu-embeddings/frontend/node_modules/@sveltejs/kit/src/runtime/server/index.
Read more →

Fixing Svelte VS Code e.children.findLastIndex Is Not a Function

The Problem I recently created a new SvelteKit project using the Svelte 5 preview and kept getting an error at the beginning of every Svelte component: The error was e.children.findLastIndex is not a function (svelte). It was showing up even on the basic SvelteKit skeleton starter project as soon as I added a <style></style> block. The Fix I looked around online, and I didn’t see anyone having this problem. This led me to believe that it was likely an issue with my local environment or configuration.
Read more →

Investigating Bogus Plausible Analytics Traffic

I run self-hosted Plausible analytics to keep track of how many people are visiting my various websites and web apps. I’m largely very happy with it - it gives me all of the info I need with only a miniscule JS payload, no cookies or other invasive tracking, and full control over the data. However, recently I’ve been running into an issue with fake/bogus traffic getting submitted for my personal homepage.
Read more →