Skip to content

/dist/packages/block-library-style.css 404 (Not Found) #1198

@marklchaves

Description

@marklchaves

Describe the bug

dist/packages/block-library-style.css is never generated by the webpack build, causing a 404 for the popup-maker-block-library-style enqueued stylesheet and missing frontend styles for CTA button blocks.

Image

Site information

Popup Maker version: 1.22.0

WordPress version: X.X.X

PHP version: X.X.X

Expected behavior

The webpack build should emit dist/packages/block-library-style.css (and its RTL counterpart block-library-style-rtl.css).

classes/Controllers/Assets.php explicitly registers and enqueues the popup-maker-block-library-style handle pointing to that path, and the source SCSS files exist in the repo — so the file should be present in the release ZIP.

Current behavior

dist/packages/block-library-style.css is absent from the v1.22.0 release ZIP. The dist/package-assets.php build manifest contains no entry for it, confirming the build never emitted the file. This produces a 404 for the enqueued stylesheet and leaves CTA button blocks unstyled on the frontend.

The following files are present in dist/packages/:

  • block-library.js
  • block-library.css
  • block-library-style-rtl.css — also missing

Steps to reproduce

  1. Install Popup Maker 1.22.0.
  2. Load any front-end page that enqueues the block library (e.g. a page containing a CTA button block).
  3. Open the browser DevTools Network tab and filter by CSS.
  4. Observe a 404 for dist/packages/block-library-style.css.

Alternatively, inspect the release ZIP directly — dist/packages/block-library-style.css is not present.

Errors

GET /wp-content/plugins/popup-maker/dist/packages/block-library-style.css 404 (Not Found)

Additional context

Root cause: The @wordpress/scripts webpack splitChunks rule that extracts a separate *-style.css chunk is triggered by a file named style.scss at the root of the package's src/ directory. In the block-library package, the relevant stylesheets live in nested subdirectories:

  • packages/block-library/src/lib/cta-button/style.scss
  • packages/block-library/src/lib/cta-buttons/style.scss

Because there is no style.scss at packages/block-library/src/, the split never fires and the output file is never produced.

Affected code in classes/Controllers/Assets.php:

  • The block-library entry is declared with 'block_styles' => true, signalling that a separate style chunk is expected.
  • The registration loop reads that flag and calls wp_register_style( 'popup-maker-block-library-style', .../dist/packages/block-library-style.css ).
  • A subsequent enqueue call enqueues that handle — pointing to a file that does not exist.

Suggested fix (upstream): Add a root-level packages/block-library/src/style.scss that re-exports the nested block stylesheets so the splitChunks rule picks them up, or add an explicit webpack entry for the style file so it is emitted independently of the chunk-splitting heuristic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions