This guide covers debugging tools and development features available in GutenbergKit.
Development mode (?dev_mode query parameter) enables debugging features and bypasses certain production behaviors to simplify development and testing:
- Development notice is displayed - A warning notice appears to inform developers that they're running in development mode.
- Make GBKit global optional - If the native bridge (
window.GBKit) is not available, the editor is allowed to load without native integration, but some features may be limited. - React Dev Tools integration - The editor connects to the React Dev Tools standalone server for component inspection and debugging. See the React Dev Tools section below for setup instructions.
Add the ?dev_mode query parameter to the editor URL:
http://localhost:3000/?dev_mode
The React Developer Tools allow inspecting React components, view props and state, and debug the component tree during development. GutenbergKit supports the standalone DevTools server for both browser and native WebView debugging.
-
Start the standalone DevTools server:
make dev-tools
This opens a standalone window that will display your React component tree.
-
Start the development server:
make dev-server
-
For Android emulators only, set up port forwarding:
adb reverse tcp:8097 tcp:8097
-
Load the editor with development mode enabled:
Browser or iOS simulator:
http://localhost:5173/?dev_modeAndroid emulator:
http://10.0.2.2:5173/?dev_modeThe editor will automatically connect to the DevTools server, and your component tree will appear in the standalone window.
The logger utility (src/utils/logger.js) supports different log levels that can be controlled via:
- The
logLeveleditor configuration option, for controlling the client console; - And Node.js environment variables (
LOG_LEVEL=<level>), for project scripts.
The default log level is info. The project's demo app defaults to debug. Available log levels are:
error: Logs only error messageswarn: Logs warnings and errorsinfo: Logs informational messages, warnings, and errorsdebug: Logs detailed debugging information, informational messages, warnings, and errors