Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteTo run Loki in Docker, install Loki in your Storybook project, choose the chrome.docker target, start the Storybook server yourself, then run yarn loki update once to create baselines and yarn loki test on every change. Loki launches Chrome inside a container, captures each story, and compares it with the approved reference images. This guide gives the full sequence, the Docker-specific flags, a CI-style script, and fixes for the failures you are most likely to hit.
A caveat first: Loki’s getting-started and CLI pages both show a last-updated date of 2024-08-27. Treat the defaults quoted below (Node version, Chrome image tag, folders) as documented values to check against your installed Loki version, not as guarantees for today.
As an Amazon Associate I earn from qualifying purchases.
What you need before you start
- A Storybook project. Loki is a visual regression tool for Storybook; it screenshots stories.
- Node 16 or newer, according to the Loki getting-started guide (historical documentation, last updated 2024-08-27; confirm against your installed release).
- Docker, needed for the
chrome.dockertarget. Local Chrome (documented as Chrome 59+) is only an optional alternative, and screenshots from a local browser vary by operating system, which is the problem Docker avoids. Loki’s stated aims include reproducibility across operating systems and CI support; those are project goals, not measured guarantees. - GraphicsMagick only if you pick the
gmdiff engine.
Step-by-step: first run
- Install and initialize Loki.
yarn add loki --dev yarn loki initThis is the setup the official guide gives. The init step generates Loki’s configuration, including the Docker-based Chrome target.
- Start Storybook. Loki does not do this for you. The docs say: “For loki to be able to access your stories you must start the storybook server.”
yarn storybookLeave it running in its own terminal.
- Create the reference screenshots.
yarn loki updateLoki captures every story in the Docker Chrome container and writes baselines to
./.loki/reference. - Look at the baselines. A reference that captures a spinner, an error state or a half-rendered component will make every later run meaningless. Fix the story before committing.
- Commit the
.loki/referencefolder. The guide says Git LFS is optional, so it is a choice for large repositories, not a requirement. - Run the comparison.
yarn loki testFresh captures go to
./.loki/current. Any story that differs from its reference produces an image in./.loki/difference. - Review, then approve intended changes.
yarn loki approveThis promotes the current screenshots to references. The CLI also suggests a command that approves only the failing stories, which is safer than approving everything. Commit the updated references with the code change that caused them.
Docker options that matter
The CLI reference documents these Docker-related flags:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitches| Flag | What it does | Use it when |
|---|---|---|
--chromeDockerImage |
Selects the Chrome container image. The documented default is yukinying/chrome-headless-browser-stable:118.0.5993.117 (2024 docs). |
You need to pin or change the Chrome build. Treat the default tag as a historical example and check what your Loki version expects. |
--dockerNet |
Passes a Docker network mode, such as host or bridge. |
The container cannot reach the Storybook server on the host. |
--chromeDockerUseCopy |
Copies local stories into the container instead of using a volume mount. | Volume mounts fail, which can happen when Docker itself runs remotely or inside another container in CI. |
--dockerWithSudo |
Runs Docker commands with sudo. | Your user is not allowed to call Docker directly. |
Other CLI options relevant to this setup are --host and --port, for Storybook servers not on the default address. The docs list three diff engines: pixelmatch, looks-same and gm, and default folders ./.loki/reference, ./.loki/current and ./.loki/difference.
#1 Best Overall
Passing arguments through Yarn or npm
The CLI docs say to prepend arguments with -- so the package manager forwards them to Loki, and illustrate it with:
yarn loki test -- --port 9009
Argument forwarding differs between package-manager versions. If a flag seems ignored, run the Loki binary directly (for example through npx loki test --port 9009) and compare.
Rank #2
Example: a CI-style script
This is an illustrative script built from the documented commands, not an official template. It starts Storybook in the background, waits for it, runs Loki, and always stops the server. Adjust the port, wait mechanism and flags for your project.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#!/usr/bin/env bash
set -euo pipefail
yarn storybook --ci &
SB_PID=$!
trap 'kill $SB_PID' EXIT
# wait until Storybook answers (port 6006 is Storybook's usual default)
until curl -sf http://localhost:6006 > /dev/null; do sleep 2; done
yarn loki test
If this fails because the container cannot see the server, add the network flag, for example yarn loki test -- --dockerNet host. If it fails because of volume mounting, try --chromeDockerUseCopy. The official docs do not establish one universally correct Docker network setup for every CI environment, so expect to test which combination your runner needs.
Rank #3
Making runs stable
Failed network requests fail the test
By default, Loki’s configuration fails a story when one of its network requests fails. Stub APIs, use local fixtures, and avoid external fonts or images that may be unreachable from the container. This is the right default: a screenshot with a broken image is not a valid baseline.
Animations
Animation timing changes pixels between runs. The flaky-test guidance documents disabling animations through the chromeEnableAnimations option. Disable them unless the animation itself is what you want to test.
Asynchronous stories
If a story needs time to finish rendering, Loki documents an async callback pattern so the story can signal when it is ready, rather than relying on luck with timing.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Loki cannot fetch stories or reports a connection error | Storybook is not running, or is on another host or port. | Start yarn storybook first; pass --host / --port if non-default. |
| Storybook works in your browser but not from the container | The container’s network mode cannot reach the host server. | Try --dockerNet host or bridge and confirm the server is not bound only to a loopback address the container cannot reach. |
| Docker permission denied | Your user cannot run Docker. | Add the user to the Docker group, or use --dockerWithSudo. |
| Stories are missing or empty in the container | Volume mount problem. | Use --chromeDockerUseCopy. |
| A flag appears to have no effect | The package manager swallowed it. | Add -- before Loki’s arguments, or call Loki directly. |
| A story fails with a network error | A request in the story failed, and the default is to fail the test. | Mock or serve the resource locally. |
| Diffs appear on unchanged stories | Animations or async rendering. | Disable animations with chromeEnableAnimations; use the async completion callback. |
| Image pull or Chrome behaviour differs from the docs | The documented default image is from 2024 documentation and may not match your Loki version. | Check your installed version’s docs, or set --chromeDockerImage explicitly. |
| Everything differs after a Chrome image change | A new Chrome build renders text and anti-aliasing slightly differently. | Pin the image, and regenerate and commit references in the same change as any image bump. |
Review habits that keep baselines trustworthy
- Open both
currentanddifferenceimages before approving; do not approve blindly after a red run. - Prefer approving only failures over approving everything.
- Keep reference images in the same pull request as the UI change, so reviewers see the visual diff beside the code.
- Generate baselines in Docker, never from a local Chrome, so CI and developer machines match.
Or skip the browser setup
Loki answers a specific question: did this Storybook component change? If what you actually need is a screenshot of a page or URL (for monitoring, previews, reports or an AI agent), you do not need a Storybook server, Docker image or network flags. ScreenshotNeo is a website screenshot API: one GET request with a URL returns a PNG, JPEG, WebP or PDF. Full options are in the ScreenshotNeo docs.
Best Value
- Docker, Docker Swarm, Docker Compose, Programmer, Developer, Coding, Programming, Software Engineer, Code, DevOps, Deploy, Deployment, Kubernetes, Salt, Puppet, Chef, Terraform, Container, AWS, Azure, Cloud, Geek, Funny, Computer, Software, Tech, IT
- Integration, Scrum, Compile, Compilation, Science, Bug, Debug, Python, Linux, Java, Javascript, Scala, Dotnet, Kotlin
- Lightweight, Classic fit, Double-needle sleeve and bottom hem
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
- Cookie banners, newsletter popups and chat widgets are removed before the shot (60+ known consent platforms are handled, and each step can be turned off).
- Bot checks, blank pages, timeouts, failed loads and cache hits are never billed; the
X-Page-VerdictandX-Billedresponse headers tell you which it was. - Full-page capture, single-element capture by CSS selector, dark mode, device presets, waiting for a selector or network idle, and HTML/CSS to image are all available on every plan.
- An MCP server (tools
take_screenshot,get_page_info,capture_pdf) lets AI agents in Claude, Cursor or any MCP client take screenshots. - 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000.
Create a free ScreenshotNeo account and make your first call in a minute.
Frequently Asked Questions
Does Loki start Storybook for me?
No. You must start the Storybook server before running Loki, as the project documentation states.
Can I use Loki without Docker?
Yes, Loki can target a locally installed Chrome (documented as Chrome 59+), but rendering can differ between operating systems, which is why Docker is used for consistent baselines.
Do I need Git LFS for the reference images?
No. The getting-started page describes Git LFS as optional.
Is Loki a replacement for a screenshot API?
No. Loki compares Storybook stories against approved baselines. A screenshot API captures arbitrary URLs and returns an image or PDF.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




