markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.57k stars 1.01k forks source link

CSS SourceMaps not generating correctly - Magento 2.4.6 EE - Docker Magento Build 43.2 & 44 #878

Open stephen-larkbury opened 1 year ago

stephen-larkbury commented 1 year ago

Description

After upgrading to Magento 2.4.6 EE on both docker-magento versions 43.2 and 44 and using grunt (as per setup instructions) i am getting a console error of DevTools failed to load source map: Could not load content for https://MYTHEME.local/static/version1678749398/frontend/MYTHEME/default/en_GB/css/pub/static/frontend/MYTHEME/default/en_GB/css/styles-l.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

(Replaced my actual theme name with MYTHEME)

The sourcemap file should be https://MYTHEME.local/static/version1678749398/frontend/MYTHEME/default/en_GB/css/styles-l.css.map

The issue seems to be the same as this ticket https://github.com/magento/magento2/issues/20952 Within the actual styles-l.css.map file it is adding a full directory path again to every file (see screenshot)

Screenshot 2023-03-14 at 00 33 18

Steps To Reproduce

  1. This is occurring on the vanilla version of Magento 2.4.6 Enterprise when using the self install script and setting up grunt to run

Expected Result

Source maps should work as expected

magedevjosh commented 1 year ago

I've run into this issue before and found if I downgraded the "grunt-contrib-less" package to "1.4.1", that resolved the issue. Not sure why that resolves the issue but it's based off this SO thread: https://magento.stackexchange.com/questions/305851/magento-2-css-source-maps-not-working