Skip to content

Stimulus is always in debug mode #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ameotoko opened this issue Apr 18, 2025 · 2 comments
Closed

Stimulus is always in debug mode #120

ameotoko opened this issue Apr 18, 2025 · 2 comments

Comments

@ameotoko
Copy link
Contributor

ameotoko commented Apr 18, 2025

After #99, application.debug is always true in any environment. I found it after noticing that debug messages are always logged in console.

I assume it has something to do with a new bundler, which for some reason removed the environment check. Just compare these lines in the compiled code (source is unchanged):

v3.2.3

function startStimulusApp(context) {
const application = Application.start();
if (process.env.NODE_ENV === 'development') {
application.debug = true;
}

v4.0.0

function startStimulusApp(context) {
const application = Application.start();
application.debug = true;
if (context) application.load(definitionsFromContext(context));

@Kocal
Copy link
Member

Kocal commented Apr 18, 2025

Hi, thanks for your report and your investigation, I didn't notice these lines changed when migrating to Rolldown.

I'm gonna open a PR asap

Kocal added a commit to Kocal/symfony-stimulus-bridge that referenced this issue Apr 18, 2025
@Kocal Kocal closed this as completed in 9805e0d Apr 18, 2025
Kocal added a commit that referenced this issue Apr 18, 2025
…iles, close #120 (Kocal)

This PR was merged into the main branch.

Discussion
----------

Keep `process.env.NODE_ENV === "development"` in the built files, close #120

Commits
-------

9805e0d Keep `process.env.NODE_ENV === "development"` in the built files, close #120
@Kocal
Copy link
Member

Kocal commented Apr 18, 2025

Fixed by #121, it has been released in 4.0.1 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants