Registry / web-framework / chii
library1.1.4jsnpmunverified

Chii is a remote debugging tool that serves as a modern alternative to Weinre, providing a full-featured web inspector experience by integrating the latest Chrome DevTools frontend. It enables developers to inspect and debug web pages across different environments or remote devices by injecting a small `target.js` script into the target page. The package is currently at version 1.15.5, indicating active development with frequent patch releases addressing fixes and minor feature additions (e.g., shadow DOM, dark mode) in its recent 1.x series. Chii operates by running a local server, acting as a proxy between the Chrome DevTools interface and the remote target, offering a familiar and powerful interface for debugging elements, network activity, console logs, and more, which is its primary differentiator against older remote debugging tools.

npm install chii
INSTALL
IMPORT
SIG · CHII
C
chii
web-frameworkjavascriptv1.1.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

startServer
import { startServer } from 'chii';
const { startServer } = require('chii');
For programmatic use to start the Chii debugging server. The package is primarily a CLI tool, but exposes this function for integration. ESM is preferred.
ChiiConstants
import * as ChiiConstants from 'chii/lib/constants';
import { Constants } from 'chii';
Common utility constants used internally, which might be useful for advanced programmatic integrations. Direct import from `lib/constants` is typically required.
ChiiUtil
import * as ChiiUtil from 'chii/lib/util';
import { util } from 'chii';
Various utility functions. Similar to constants, these are exposed from specific internal paths rather than the main entry point.

Demonstrates global installation, starting the Chii server, and injecting the target script into a web page for remote debugging.

npm install -g chii chii start -p 8080 # In your target HTML file, inject the script: # <script src="//host-machine-ip:8080/target.js"></script> # Then, open http://localhost:8080 in your browser to start debugging. # Replace 'host-machine-ip' with the actual IP address of the machine running Chii if debugging from a different device.
chii --version
Debug
Known issues
gotchaWhen debugging from a different device (e.g., a mobile phone), ensure you use the actual IP address of the host machine running Chii in the `<script src="//host-machine-ip:8080/target.js"></script>` tag, not `localhost` or `127.0.0.1`. Firewalls can also block connections, requiring explicit allowance for the specified port.
fix
Use your host machine's local network IP address (e.g., `192.168.1.X`) and configure firewall rules to allow connections on the Chii port.
affects: >=1.0.0
gotchaOlder versions (prior to 1.15.2) had a 'ws dead loop' issue which could cause WebSocket connections to repeatedly fail, leading to an unstable debugging experience and potential performance degradation.
fix
Upgrade Chii to version 1.15.2 or later to benefit from the fix for WebSocket stability.
affects: <1.15.2
gotchaMemory leaks were reported and fixed in versions prior to 1.14.0. Running older versions for extended periods could lead to increased resource consumption and potential crashes of the Chii server.
fix
Update Chii to version 1.14.0 or newer to resolve known memory leak issues.
affects: <1.14.0
gotchaVersion 1.15.5 includes a fix for 'invalid route path in koa router', indicating that prior versions might have experienced issues with certain API routes, potentially affecting the functionality of specific DevTools panels or features.
fix
Upgrade to Chii 1.15.5 or later to ensure all routes and DevTools functionalities operate correctly.
affects: <1.15.5
Errors
Common errors & fixes
ERR_CONNECTION_REFUSED
The client device (e.g., mobile phone) cannot connect to the Chii server, often due to incorrect IP address, firewall, or the server not running.
fix
Verify the Chii server is running (`chii start`). Use the host machine's local network IP address in the target script (`<script src="//YOUR_IP:8080/target.js"></script>`). Check firewall settings on the host machine to allow traffic on the specified port.
chii: command not found
The `chii` command-line tool is not installed globally or is not in your system's PATH.
fix
Install Chii globally using `npm install -g chii`. If already installed, ensure your system's PATH includes the directory where npm installs global packages.
Failed to load resource: net::ERR_CONNECTION_CLOSED (or similar network error for target.js)
`target.js` could not be fetched from the Chii server, usually because the server is down, the port is wrong, or the IP address in the script tag is incorrect.
fix
Confirm the Chii server is active on the expected port (`chii start -p 8080`). Double-check the IP address and port in the `<script src="//host-machine-ip:8080/target.js"></script>` tag in your HTML.
Upgrade
Version history
1.1.4latest on npm
Audit
Dependencies
chobitsurequiredChobitsu is used for Chrome DevTools Protocol (CDP) JavaScript implementation, crucial for Chii's core functionality.
Agent activity
41 hits · last 30 days
node
36
OpenAI (training)
1
Resources
chii — npm install chii · libregistry