React web apps

For AI agents: this page is Markdown at https://squiggle.sh/docs/web.md. Every docs page is listed at https://squiggle.sh/llms.txt, and all of them are one file at https://squiggle.sh/llms-full.txt.

Squiggle drives a React web app in a Chrome window of its own: it reads the page, taps and types with real input, and records what the app does, with nothing added to your project. A flow written for your iOS app runs on the web version unchanged when the two share testIDs.

Before you start

  • A React app that renders with react-dom (React 18.3 or later), served by its dev server: Vite, Next.js, or anything else that serves the page on a local port.
  • macOS on Apple Silicon, or Linux on x64 or arm64. On Linux, install the CLI with npm install -g @squiggle.sh/cli; Studio is macOS only.
  • Google Chrome, Chromium or Microsoft Edge installed. Squiggle drives Chromium browsers only, and picks the first of the three it finds. To choose one, add --browser with its path or, on Linux, its command name: --browser chromium.
  • A development build. A production build served on your machine works too, with --production; see Measure a production build.

How it fits together

  • squiggle CLIFlows, perf, probes and bench
  • StudioMirror, inspect and record the tab
  • Your agent (MCP)describe, tap, run_intent, crawl
Your React app’s pagereact-dom, React 18.3 or later, served by your dev server

Two ways in

  • Squiggle's windowA Chrome window of its own, opened when a flow, Studio or your agent needs it, with nothing added to your project
  • A bundler plugin@squiggle.sh/react in Vite, Next.js, webpack or esbuild, for any Chromium browser on your dev server

The CLI, Studio and your agent all drive the same page, in one Chrome window Squiggle opens the first time any of them needs it, with nothing added to your project. A bundler plugin adds Squiggle to the page when you want to use a browser you opened yourself.

Your first web flow

From a running dev server to a passing flow in four steps. This example is a to-do app on Vite’s port, 5173.

  1. Start your dev server

    Start it as you always do. There’s nothing else to open: the run in step 4 opens the app in a Chrome window of Squiggle’s own.

  2. Give the control a testID

    A data-testid is the most reliable way for a flow to find a control. Your iOS app’s testIDs work the same way, so one flow can run on both.

    TypeScript
    <input data-testid="new-todo" placeholder="What needs doing?" />
  3. Write the flow

    Save this as .squiggle/flows/add-todo.yaml:

    YAML
    flow: add a todosteps:  - launchApp  - type: { into: { testID: new-todo }, value: Buy oat milk }  - pressKey: Enter  - assert: { visible: { text: Buy oat milk } }
  4. Run it

    The window opens on the first run and stays open until you close it, and later runs use it. Each step waits for the page to settle, and the last one fails if the to-do never appears:

    Terminal
    squiggle flow add-todo --udid web:http://localhost:5173

Next, check what else a flow can do in Assertions, or record one in Studio instead of writing it (see Record and crawl).

Open your app in Squiggle

A flow, Studio or your agent opens the app in Squiggle’s window when it needs it, at the address under apps.web in .squiggle/config.jsonc (or the one in --udid web:<origin>). The window stays open until you close it, the way a simulator stays booted, and every run uses it. To open it yourself, before anything else needs it:

Terminal
squiggle up --url 5173

--url takes a port, a port and path (5173/settings), a host and port (localhost:5173) or a full URL. Squiggle opens the page in a Chrome window of its own, with its own profile, so your browser and its extensions aren’t touched. When the page connects, the command prints ready — web:http://localhost:5173. squiggle up 5173 does the same: an address in place of a bundle id (a port, :5173, a host and port, or a URL starting http:// or https://) opens that web app.

The command returns once the page connects, and the window stays open. If your dev server is still starting, Squiggle waits up to 20 seconds for it to answer, then stops with the dev server at http://localhost:5173/ isn’t answering and the command that starts it. Closing the window is how you stop it; the next run opens a new one. Chrome quits with the window, on macOS too, and its profile is deleted. If the Squiggle process that keeps the window open is stopped or crashes, the window closes the same way, so no Chrome is left running and no profile is left on disk.

In a project whose only app is a web app (apps.web in .squiggle/config.jsonc), or one that sets web.url, squiggle up with no --url opens it. In a project set to "platform": "web" with neither, it looks for the dev server your bundler runs (Vite on 5173, Next.js on 3000, or the port your dev script names) and opens it when exactly one answers; when several answer, or none, it stops with E_NO_URL and lists what it found. In a project that also has an iOS or macOS app, squiggle up brings that app up; pass --url for the web app.

Run a flow

A web app is named by its origin, prefixed web:, wherever Squiggle asks for a device:

Terminal
squiggle flow login --udid web:http://localhost:5173

Your agent finds the window too: status lists it beside any app in the simulator, with its tabs and whether the project owns it, and target switches to it. In a project whose app is a web app, the first tool that needs the app opens the window. launch_app { url: "5173" } opens another address, or uses the window already open on it.

Start from a clean slate

squiggle flow --fresh, a flow’s reset: relaunch and launch_app { relaunch: "always" } reopen the app in a new tab with no cookies, storage or cache, the way a first visit starts, at the address the window opened. clearState clears the app’s cookies and storage in the window it’s in before reopening it, and stopApp closes its tabs.

Start signed in, or as a returning visitor

A seed on launchApp reopens the app with cookies, localStorage and sessionStorage already set, so the first page load reads them:

YAML
- launchApp:    seed:      cookies: [{ name: session, value: 4f9c2e81 }]      localStorage: { theme: dark, onboarded: true }      sessionStorage: { checkoutStep: shipping }

A cookie with no domain belongs to the app’s host, and one with no path to /; a cookie also takes expires, httpOnly, secure and sameSite, as Playwright’s addCookies does. A storage value that isn’t a string is stored as JSON. The storage is written once, before the page’s own scripts run, so a reload keeps whatever the app changed. A seed always reopens the app in a new tab, which starts with none of a run’s emulate settings: put emulate after launchApp.

On iOS a seed reports unsupported and the app isn’t launched. To start an iOS app from saved data, use a save slot: squiggle save, then squiggle load.

Set the browser up for a flow

emulate sets how the browser presents itself for the rest of the run: the viewport, the colour scheme, the locale and the user agent. The device steps set what the page can read, such as its permissions and location:

YAML
flow: checkout on a phonesteps:  - launchApp:      seed:        cookies: [{ name: session, value: 4f9c2e81 }]  - emulate:      viewport: phone      userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1"      colorScheme: dark      locale: de-DE  - setPermissions: { permissions: { location: allow } }  - setLocation: { latitude: 52.52, longitude: 13.405 }  - tap: { testID: checkout }  - assert: { visible: { testID: delivery-address } }
  • viewport: phone lays the page out on a 390×844 phone screen, as a phone’s browser would. It keeps the browser’s own user agent: set userAgent too when your app reads it to decide what to show. To tap and swipe with touch events instead of a mouse, set mobile: true on web.viewport in your config (see Choose the browser and the screen).
  • userAgent also sets the User-Agent header and the client hints the string implies: platform, version and whether it’s mobile.
  • locale changes how Intl formats numbers and dates, navigator.language and the page’s Accept-Language.
  • Put emulate after launchApp: a launch opens a new tab, which starts without the run’s settings.

On iOS and macOS, emulate reports unsupported. Every option of each step is in the flow reference.

Share flows with your iOS app

Declare the web app in .squiggle/config.jsonc under apps, beside your iOS app:

TypeScript
{  "apps": {    "ios": "com.example.shop",    "web": "http://localhost:5173"  }}

With that in place:

  • A flow whose appId is your iOS app runs on the web app as it is, on whatever port you point it at.
  • Runs, recordings and performance data from the web app are saved into the project, as they are for your iOS app. A web app on an origin the project doesn’t declare is driven, and nothing from it is saved; the run says so.

apps.web can include a path (http://localhost:5173/admin): Squiggle’s window opens that page, and the origin is what the project owns.

A testID matches a data-testid attribute, and label and role match aria-label and the element’s role, and checked, selected and expanded match its state (see Selectors). Routes match by path: an Expo Router group never appears in a URL, so route: (tabs)/index names the page at /.

Moving Playwright tests? See Coming from Playwright for the step that does what each Playwright call does.

Use your own browser

Without the plugin, Squiggle drives only the window it opens. To run flows in a browser you opened yourself, or in Playwright or Storybook, add Squiggle to the app.

Set it up with squiggle init

In a Vite or Next.js app, run squiggle init in the app directory. It lists each change and asks before writing anything: it adds @squiggle.sh/react at the CLI’s own version, adds the plugin to your Vite or Next.js config (and, in a Next.js app, imports Squiggle first in instrumentation-client.ts), declares your dev server’s origin under apps.web, and writes a first flow, smoke. squiggle init --dry-run prints the list and writes nothing. The origin uses the port your dev script or Vite config names, or 5173 for Vite and 3000 for Next.js. Then start your dev server and run the flow, which opens the app in Squiggle’s window:

Terminal
squiggle flow smoke

For any other bundler, init prints what to do instead.

Set it up by hand

Terminal
bun add @squiggle.sh/react

With Vite, add the plugin:

vite.config.ts
import react from '@vitejs/plugin-react';import { squiggle } from '@squiggle.sh/react/vite';import { defineConfig } from 'vite';export default defineConfig({  plugins: [react(), squiggle()],});

With Next.js, App Router or Pages Router, wrap your config, and import Squiggle first in instrumentation-client.ts (in src/ if your app has one):

next.config.ts
import { withSquiggle } from '@squiggle.sh/react/next';export default withSquiggle({  // your Next.js config});
instrumentation-client.ts
import '@squiggle.sh/react';

With webpack or Rspack, add the plugin. It runs Squiggle in a build with mode: 'development' only:

webpack.config.js
const { squiggle } = require('@squiggle.sh/react/webpack');module.exports = {  mode: 'development',  entry: './src/main.tsx',  plugins: [squiggle()],};

With esbuild or Bun.build, add the plugin from @squiggle.sh/react/esbuild; it works with both. It runs Squiggle in a development build only: one that defines process.env.NODE_ENV as "development", or, with that left undefined, one that isn’t minified. For a production Bun.build, define process.env.NODE_ENV as "production", as React needs too. Bun.build renames the second of two components with one name (two Rows become Row and Row2), and Squiggle shows them by those names.

build.ts
import { squiggle } from '@squiggle.sh/react/esbuild';import { build } from 'esbuild';await build({  entryPoints: ['src/main.tsx'],  bundle: true,  outdir: 'dist',  plugins: [squiggle()],});

Declare the app’s origin under apps.web, as in Share flows with your iOS app: Squiggle accepts a connection only from an origin your project declares. Then start your dev server, open the app in your browser, and run a flow with --udid web:<origin>.

With the plugin, the page also says which directory it was built in, and its data is saved only into the project that contains that directory. Two projects can both run their dev server on localhost:3000; each one’s runs stay in its own project. Run Squiggle from another project and the run says nothing was saved, and why.

Your agent finds the page too. When nothing your project owns is up, it waits a couple of seconds for a page to connect, and drives your app rather than a window another project opened. target lists the page as web:<origin> with dialledIn: true, and target { to: "web:http://localhost:3000" } switches to it.

The page connects to Squiggle on port 7777 of the machine it runs on. If your dev server uses HTTPS, or you open the app from another machine, connect through the dev server instead: pass transport: 'proxy' to the Vite or Next.js plugin, as in squiggle({ transport: 'proxy' }) or withSquiggle(config, { transport: 'proxy' }). The page then connects to /__squiggle on your dev server, which passes the connection on to Squiggle. Declare the origin the browser uses, such as https://localhost:5173 or http://192.168.1.20:5173. While no Squiggle command is running, next dev prints Failed to proxy each time the page tries again; that stops once one starts. The webpack and esbuild plugins connect directly only.

In a browser Squiggle didn’t open, steps run through the page itself. Taps, checkboxes and typing work; long presses, swipes, drags and pinches need Squiggle’s window.

The plugin also lets Squiggle see your zustand stores (zustand 5), in your own browser and in Squiggle’s window. Each store is named after the variable it’s assigned to, so export const useCart = create(…) is useCart in assert: { store }, as in your iOS app. Without the plugin, stores aren’t seen. Stores made with createStore from zustand/vanilla aren’t seen either; import it from zustand instead.

Legend State (version 3) works the same way: with the plugin, stores made with observable and useObservable show up, under ids such as store:legend-1 in the order they are made. Without the plugin they aren’t seen.

Squiggle runs only under the dev server. A production build gets a stand-in with the same functions and none of Squiggle, so it never connects from your users’ browsers; see React web apps. It also runs only in the browser: code that imports it and renders on the server, such as a Next.js server component calling identify, does nothing there.

The SDK’s functions, such as identify, logEvent and defineAction, come from @squiggle.sh/react. See the SDK reference.

Render <SquiggleOverlay /> anywhere in your app to get a button that opens a live list of your components and stores, as on React Native. It shows only under the dev server, and never in Squiggle’s window.

Record errors React keeps to itself

With React 19, an error no error boundary catches, and a hydration mismatch React recovers from, are handed only to the root. Pass squiggleRootOptions() to createRoot or hydrateRoot and Squiggle records them with their component stack:

main.tsx
import { squiggleRootOptions } from '@squiggle.sh/react';import { createRoot } from 'react-dom/client';createRoot(document.getElementById('root')!, squiggleRootOptions()).render(  <App />);

Pass your own onUncaughtError or onRecoverableError to squiggleRootOptions and it still runs; without one, React reports the error as it does by default.

What works

Reading the page
describe, find and query, with the page’s buttons, links and fields as well as your components. Elements hidden with display: none are left out. Controls inside a shadow root or a same-origin iframe are read and tapped like any other.
Your code
describe { fields: 'source' } gives each element the line that writes it, and find { callSite } shows what a line renders. inspect shows a component’s props, state and hooks, each hook named after the variable it’s assigned to. Both read your dev server’s source maps, so they need no setup, and work in a development build only.
Input
Taps, typing, keys, scrolling, drags and two-finger pinches, as real input in Squiggle’s window. A swipe on something that doesn’t scroll, such as a slider or a sortable row, drags it. A tap on a disabled control is refused rather than reported as done, and a tap on an element the page doesn’t draw doesn’t reach it. Scrolling the page or a list, by wheel, touch, keys or a step, is saved with the run for the heatmap and product analytics.
Layout widths
--breakpoints finds the page widths where your layout changes; see Find the widths where your layout changes.
Alerts and prompts
A page’s alert, confirm and prompt appear in describe like a system alert in your iOS app: its message, a text field for a prompt, and its OK and Cancel buttons. tap { text: OK } answers it, and text typed into a prompt’s field goes with its OK. One that appears while nothing is driving the window is closed, so the window doesn’t stay blocked.
Tabs and popups
Every tab of the app in Squiggle’s window connects, a popup the page opens included. A run drives the newest tab; the others wait. A link or form that loads a whole new page keeps the run going on the new page.
Waits and assertions
Waits finish when animations, scrolling and loading boundaries have finished, so a page that is still loading isn’t asserted on. A route wait also waits for the new page to appear, with or without --headless. Requests from the page’s workers count toward network idle.
Navigation
navigate, route and waitFor: { route } follow the page’s URL, with React Router, TanStack Router, and the Next.js App and Pages Routers. With React Router, TanStack Router and the Pages Router, a screen tour can list every route the app declares; the App Router keeps its routes on the server, so it can’t.
State
TanStack Query’s queries, and store changes in Redux (through react-redux’s Provider) and Jotai, show up in the graph, so assert: { query } and assert: { store } work as on a device. zustand and Legend State stores show up too when the app loads Squiggle through a plugin (see Use your own browser).
Save and load
squiggle save and squiggle load keep the page’s path, its stores, localStorage, sessionStorage, the cookies the page can read, and its IndexedDB databases. See Save and restore your app’s state.
Device settings
Flow steps that set the location (setLocation, travel), turn the viewport (setOrientation), take the tab offline (setAirplaneMode), grant or deny a permission (setPermissions), hand files to a file picker (addMedia), run JavaScript in the page (evalScript, runScript), and set the viewport size, colour scheme, locale and user agent (emulate). Each lasts until the run ends. A phone viewport keeps the browser’s own user agent; set userAgent as well to look like a phone to code that reads it. See the flow reference.
Screenshots, video and motion
screenshot, flow --record (30 frames a second unless --record-fps sets another rate), filmstrips, the visual checks (noBlankFrame, legibleContrast, noOverlap), and the checks that read every frame: assert: { smooth }, a scroll’s blank band, and squiggle motion. record_start and record_stop record a session, or film the tab with video: true, and squiggle replay checks a flow’s assertions against it.
Network
Stubs and the chaos profiles (--chaos slow, flaky, truncated, offline-midstep) apply to the app’s fetch and XHR requests. The page’s own scripts and styles are left alone. While a stub or a chaos profile is set, the page bypasses its service worker, so a request the worker would answer from its cache meets the stub too.
Errors and logs
Uncaught errors, rejected promises and Content Security Policy refusals are saved with the run, and so are the page’s console lines, which assert: { log } checks.
Exploring and suites
squiggle crawl and the crawl tool explore the app; a link that loads a whole new page is followed, not reported as a crash. squiggle flows --udid web:<origin> runs a suite; with --shards 3 it runs three flows at a time, each in a browser context of its own. squiggle bisect and squiggle bakeoff with --platform web serve each commit from a dev server of their own. squiggle flow --tune measures a tunable’s values on the tab and proposes one (see Tune a constant against measured frames). squiggle watch re-runs a flow on every save, and squiggle card (the agent’s report_card) tours and grades the screens a change touches.
Motion and legibility
squiggle motion records an element’s position and opacity at every frame and fits the spring that reproduces it. squiggle legibility names the line to fix for each control an agent can’t address.
Agents
Every MCP tool answers for the window, and the agent kit’s skills cover it.
Performance
Web Vitals (LCP, INP, CLS, TTFB, FCP), frame rate and dropped frames, main-thread CPU and the JavaScript heap, renders, CPU profiles (perf profile) and heap snapshots (perf heap). The page load is timed in phases (navigation, the document, the page scripts, the first React commit, and hydration for a server-rendered page). Reads and writes to localStorage, sessionStorage, IndexedDB (including through idb-keyval, Dexie and localforage) and cookies show up as storage activity. The dev server’s own hot-reload connection isn’t counted as your app’s WebSocket traffic. Each fetch and XHR request is timed with its DNS, connect, TLS and first-byte phases, a stall arrives with a profile naming the function that ran, and the findings work as on a simulator: long tasks, jank, memory that grows per visit, request waterfalls, motion driven from JS rather than CSS, and slower cold starts. Findings and render counts name the file and line in your source, read through the dev server’s source maps when the run ends, so propose_fix can quote them. Crashes, symbolication through source maps, squiggle probe and Web Vitals budgets work too; see Profiling, memory and crashes.

Watch and drive it in Studio

Studio lists your project’s web app (apps.web) beside your simulators, by its host (localhost:5173), marked Not open until a window shows it. Choose it on the Devices screen and Studio opens it in Squiggle’s window, the same one your flows and agent use; once the page connects it reads Running and the device panel shows the page in a browser frame:

  • Clicks, typing and scrolling on the page in the panel reach the real page.
  • The Viewport menu lays the page out at a phone’s or a tablet’s size, or the window’s own.
  • Inspect component picks the element under the pointer, including one drawn over another.
  • Capture › Screenshot saves a PNG of the page to the Gallery.
  • Recording on the Flows screen turns your clicks into steps that name the control, and Replay runs the flow on the page.
  • Performance shows a Web Vitals lane on the timeline, and Performance, Product and Analytics can show web sessions alone with their Web filter.

A browser tab has no hardware buttons, system settings, location or permissions, so those menus aren’t shown for it. Record screen and the AX tree overlay read Not available for a browser tab, and a web session has no crash reports: its uncaught errors are under Errors on the Analytics screen.

If the window is listed but the panel stays empty, close Squiggle’s window and choose the app again.

Measure a production build

A development build is slower than what your users get, so measure performance on a production build. Build the app, serve it with vite preview or next start, and open it with --production (or --prod):

Terminal
squiggle up --url 4173 --production

Flows, Web Vitals and the other measurements work as on a development build. inspect shows props and hook values but can’t edit them, and has no owners or source lines; it lists those under production.unsupported.

A production build minifies component names. To see your components by name, and to match them with component selectors, build with source maps; Squiggle reads each component’s name back from them, on Vite, webpack, esbuild and Next.js (Turbopack and webpack):

  • Vite: build.sourcemap: true, or vite build --sourcemap.
  • webpack: devtool: 'source-map'.
  • esbuild: sourcemap: true.
  • Next.js: productionBrowserSourceMaps: true in next.config.

If the server serves the .map files beside the scripts, nothing else is needed. Served maps let anyone who loads the page read your source, so a server can keep them back: then point --maps at the build’s output folder, and Squiggle reads them from there:

Terminal
vite build --sourcemapsquiggle up --url 4173 --production --maps dist

Without maps, selectors that name a component may not match; testID, label and text do. A bundler’s keep-names option (build.rolldownOptions.output.keepNames on Vite, keepNames on esbuild, Terser’s keep_fnames on webpack) keeps the names too, at the cost of a bigger bundle (about a fifth on Vite).

Choose the browser and the screen

Set these under web in .squiggle/config.jsonc:

TypeScript
{  "apps": { "web": "http://localhost:5173" },  "web": {    "browser": "chrome",    "channel": "beta",    "viewport": { "width": 390, "height": 844, "mobile": true },    "permissions": { "geolocation": "granted", "notifications": "denied" }  }}
browser and channel
Which browser Squiggle opens: chrome, chromium, edge or a path to one, on the stable, beta, dev or canary channel. SQUIGGLE_CHROME wins over both.
viewport
The page’s size in CSS pixels. With mobile: true the page sees a phone: taps, presses and swipes arrive as touch input. A flow’s emulate: viewport lasts only for its run: the page goes back to this size when the run ends.
permissions
Browser permissions for the app, such as geolocation or notifications, as granted, denied or prompt. They hold in every fresh tab a relaunch opens.
url
The address Squiggle opens when nothing else names one, in any form --url takes.

Find the widths where your layout changes

--breakpoints runs the flow, then moves the page’s width across a range and lists each width where your layout changes: a control with a testID appears, disappears or moves to another row, or starts or stops growing with the page, or changes how fast it grows. Each width is found to the pixel.

Terminal
squiggle flow web-breakpoints --breakpointsbreakpoints 320–1280 px · 48 widths measured  width (px)  what changes         400  bp-hint appears; 3 rows become 4         592  bp-panel grows 1 px per px below, 0 above         600  4 rows become 3; bp-save shares a row with bp-cancel         900  bp-sidebar appears; 3 rows become 4  swept every 32 px, then to the pixel · a change that reverts within one step can hide between two samples

The page is resized in place, without reloading, and put back at its width when the sweep ends. Use --breakpoints-range 360..1024 to sweep other widths; the low end must be at least 100. The widths it finds aren’t saved; add --json to keep them.

  • It samples every 32 px before it narrows a change down to the pixel, so a layout that changes and changes back within 32 px can be missed.
  • Only controls with a testID are followed.
  • It exits 0 when the sweep finishes, whatever it finds, and 1 if the flow fails before the sweep starts. On an iOS simulator it steps through the text sizes instead (see Run settings); add --breakpoints-range or --breakpoints-prove there to sweep the app’s width instead. On a Mac app --breakpoints sweeps the app’s width on its own.

Check every width, not only the ones you tried

--breakpoints-prove goes further: for every width in the range it says whether a control runs off the page or two controls overlap. Between two of the widths the sweep found, every control moves in a straight line as the page widens, so a control that fits at both ends of that stretch fits all the way across. Each stretch is marked:

  • proven: nothing runs off the page or overlaps at any width in it.
  • falsified: something does, with the controls and the width. Where a control comes back onto the page partway, the stretch is split at the exact width.
  • inconclusive: two controls sit side by side at one end and stacked at the other, which the two ends alone can’t settle.
Terminal
widths       verdict    why320–355 px   falsified  onScreen bp-badge at 320 px356–372 px   proven373–1280 px  proven

It exits 1 when any width is falsified, with or without --breakpoints-save. The proof is only as good as the sweep: a change that appears and reverts within 32 px can still be missed.

Catch a breakpoint that moves

To catch a breakpoint that moves, add --breakpoints-save. For each width where a control appears or disappears, it saves two flows to .squiggle/flows/, one pixel below and one pixel above, such as web-breakpoints-at-399px and web-breakpoints-at-401px. Each opens the page at that width, runs your flow and asserts which of those controls are shown. It runs them straight away and exits 1 if one doesn’t hold. Later, a saved flow fails when a change moves the breakpoint past it. A change that only moves controls between rows has nothing a selector can assert, so no flow is saved for it. The project must declare the app.

Run without a window

On a machine with no screen, or when you’d rather not see the window, set SQUIGGLE_HEADLESS=1:

Terminal
SQUIGGLE_HEADLESS=1 squiggle flow add-todo --udid web:http://localhost:5173

It starts headless by itself when the CI environment variable is set. A headless window belongs to the command that opened it and closes when that command ends: in CI, a flow opens the app for its run, and squiggle up --url keeps it open until you stop it.

Limits

  • Chromium browsers only. Squiggle doesn’t drive Firefox or Safari.
  • One window per origin. squiggle up --url for an origin that already has one says the window is already open and exits.
  • Two runs on one origin at once need two ports: the second runs in a tab of its own, with its own cookies and storage, on the port it listens on (squiggle flow login 7778 --udid …, or flows --shards). On one port the second is refused, as on a simulator.
  • The window Squiggle opened is the one it drives. A tab of the same app in your own browser isn’t connected, and doesn’t take the window’s place even when it loads the SDK through the plugin.
  • deterministic_session pins the network, the locale and animations (the page is told you prefer reduced motion, and CSS animations and transitions finish at once; motion your code drives frame by frame still moves). In a development build it also moves the page’s clock: its Date reads the instant you give and runs on, while timers keep real time.
  • Hardware buttons and native views don’t exist on the web, so steps and checks that need them don’t apply.

Troubleshooting a web app

Run squiggle doctor in the app’s directory. For a web app it checks that the plugin is in your config, that the origin is declared under apps.web, that the dev server answers, and that it serves a development build, and names the fix for each.

the dev server at http://localhost:5173/ isn’t answering (E_DEV_SERVER)
Your dev server isn’t running on that port, or didn’t answer within 20 seconds. Start it with the command the message names, then run again.
no booted web app found: no URL is configured (E_NO_DEVICE)
Your project’s app is a web app, and nothing says where it runs. Run squiggle init, or add "apps": { "web": "http://localhost:5173" } to .squiggle/config.jsonc.
several dev servers answer: …, no dev server answers at … or no web app to open (E_NO_URL)
squiggle up was given no --url, and the project names no web app, so it looked for your dev server and didn’t find exactly one. Name the one to open, as in squiggle up --url 5173, after starting it if none answers. To skip the search, add "apps": { "web": "http://localhost:5173" } to .squiggle/config.jsonc.
the window for http://localhost:5173/ did not open (E_WEB_OPEN)
Squiggle’s window didn’t open, or didn’t load the page in time. The message ends with the window’s last log lines and names its log file; read the whole log with the cat command it prints.
--url ftp://localhost:5173 names no web app (E_BAD_URL)
The address isn’t one Squiggle can open. Pass a port (5173), a host and port (localhost:5173) or a full http or https URL (http://localhost:5173/admin).
http://localhost:4173/ serves a production build (E_PRODUCTION_BUILD)
The page runs a production build of React. Add --production to measure it, or start your dev server instead.
no Chrome, Chromium or Edge found (E_NO_BROWSER)
Install one, or point Squiggle at one installed somewhere unusual with --browser /path/to/chrome. To set it for every command in a shell, use SQUIGGLE_CHROME=/path/to/chrome.
/usr/bin/chromium did not start (E_BROWSER_LAUNCH)
The browser exited or hung before Squiggle could connect to it, even after Squiggle started it a second time; the message ends with what the browser printed. In a Docker container, where a browser can’t start its sandbox, Squiggle starts it without one. If the error persists, try another browser with --browser.
no window Squiggle opened holds web:http://localhost:5173, or No page on http://localhost:5173 dialled in
Squiggle’s window for that origin closed during the run, or the page in it never connected. Check the dev server, then run again: a new window opens.
could not recognise vite.config.ts
squiggle init didn’t find a shape it can edit safely, so it left the file alone. Make the change it names yourself, as in Set it up by hand.
the dev server reloaded the page (an HMR full reload, after a file changed)
In a failed run’s app log: a file changed while the flow ran, and the dev server reloaded the page under it. Run the flow again once you’ve stopped editing.
the browser closed
Squiggle’s window was closed, so the app is no longer drivable from it. The next run opens a new one.

For anything else, see Troubleshooting.