Assets with preprocess: false and no minified: true throwing exceptions in site logs

Created on 8 May 2025, 2 months ago

Problem/Motivation

Files defined in webform.libraries.yml using preprocess: false generate logs due to an exception thrown if the file doesnโ€™t also have minified: true:

Exception: Only file JavaScript assets with preprocessing enabled can be optimized. in Drupal\Core\Asset\JsOptimizer->optimize() (line 34 of /var/www/html/docroot/core/lib/Drupal/Core/Asset/JsOptimizer.php).

Steps to reproduce

  1. Turn on dblog in a Drupal project with webform installed and asset aggregation enabled.
  2. Visit a page with a webform.
  3. Filter the logs by PHP messages and observe error messages.

Proposed resolution

As suggested in 3416508 ๐Ÿ› Only file JavaScript assets with preprocessing enabled can be optimized. Active , add minified: true to library definitions that use preprocess: false in webform.libraries.yml.

User interface changes

None.

API changes

None.

Data model changes

None.

๐Ÿ› Bug report
Status

Active

Version

6.2

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States agarzola

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024