Troubleshooting + FAQ

Quick diagnostics

  1. Confirm browser runtime (not pure Node/SSR runtime execution).
  2. Confirm Triode construction succeeds and a canvas exists.
  3. Check console for shader/runtime errors.
  4. Temporarily reduce sketch complexity to isolate pipeline issues.

FAQ

Why do I get global is not defined with Vite?

Add:

// @illustrative
define: {
  global: {},
}

Reference: <https://github.com/vitejs/vite/discussions/5912>

Why are helpers like osc unavailable?

You are likely in non-global mode.

Use either:

  • new Triode({ makeGlobal: true }), or
  • const H = triode.synth; H.osc(...).

How do I preserve object identity while livecoding?

Use explicit key values in continuous mode (liveMode: "continuous"). See Live-Key Migration.

Why are camera controls not responding?

Check camera options:

  • controls: true or controls: { enabled: true }
  • Modifier requirement defaults to alt unless changed.
  • Ensure the intended domElement receives pointer events.

Why is performance unstable?

Review:

How should host apps clean up?

Call triode.dispose() before replacing runtime instances. Also remove any external references to old runtime objects.