Skip to main content

Debugging

All controllers in this library come with a debugging mode built in.

Assuming you initialize Stimulus something like the following:

import { Application } from "@hotwired/stimulus";

const application = Application.start();

If you set a debug property on the Stimulus application,

import { Application } from "@hotwired/stimulus";

const application = Application.start();
application.debug = true;
/*
Alternatively, If you want to always have debugging enabled in development:
`application.debug = process.env.NODE_ENV === "development";`
*/

then Stimulus-Library controllers will log to the console when they connect/disconnect, when actions are called, and when events are dispatched. This makes it easy to see when you've wired up the controllers correctly and that they are behaving as expected.

debugging.png