Problem/Motivation
The generated CSS files include source map references, but the corresponding source map files are not provided.
As a result, when the affected CSS assets are loaded, the browser attempts to request the missing source map files and returns 404 responses. This causes the following warnings in the browser console or network tab:
Failed to load resource: the https://MY_SITE/modules/contrib/ckeditor_bs_grid/css/grid.css.map server responded with a status of 404 ()
Failed to load resource: the https://MY_SITE/modules/contrib/ckeditor_bs_grid/css/dialog.css.map server responded with a status of 404 ()
The affected files are:
css/dialog.csscss/grid.css
These warnings do not necessarily break the visual output, but they create unnecessary failed requests and noise in the browser developer tools.
Steps to reproduce
- Install and enable the project.
- Open a page or interface where the affected CSS assets are loaded.
- Open the browser developer tools.
- Check the Console or Network tab.
- Observe that the browser tries to load the missing source map files for
dialog.cssandgrid.css. - Observe that those requests return 404 responses.
Proposed resolution
Update the CSS build process so that source maps are not generated or referenced in the compiled CSS output.
The patch does the following:
- Adds the
--no-source-mapoption to the Sass compilation commands inpackage.json. - Removes the existing
sourceMappingURLreference fromcss/dialog.css. - Removes the existing
sourceMappingURLreference fromcss/grid.css.
This prevents the browser from requesting missing .css.map files and removes the related 404 warnings.
Remaining tasks
- Review the patch.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | remove-css-source-map-warnings-3590886-3.patch | 214.24 KB | lolgm |
Issue fork ckeditor_bs_grid-3590886
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
lolgm commentedThe proposed solution for this issue has been implemented in MR !36.
I am also attaching the corresponding patch to this comment.
Comment #4
b_sharpe commentedThanks, also relating to #3591351: Only build assets in tagged releases.