Skip to content
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

css file is without sourcemap #74

Open
DavidBruchmann opened this issue Oct 7, 2023 · 2 comments
Open

css file is without sourcemap #74

DavidBruchmann opened this issue Oct 7, 2023 · 2 comments

Comments

@DavidBruchmann
Copy link

DavidBruchmann commented Oct 7, 2023

I've a very strange issue.
I can debug the css before it gets written in the file and it includes the sourcemap, but in the css-file this sourcemap is not written.
I verified the 2 compiler classes and the hook and didn't find any fault.

It looks like the file is written in another location or at another time without the sourcemap, as it's just included in the content-string. So actually I don't have a clue why the sourcemap is missing in the css and how this issue could be fixed.

ws_scss: 11.0.3
TYPO3: 11.5.21
PHP: 8.1.24

Apart from very few additions I just use EXT:demotemplate, to give an idea about the parsed files.

@DavidBruchmann
Copy link
Author

DavidBruchmann commented Oct 7, 2023

this screenshot doesn't tell anything special more, but it shows some details to support my statements (the line number doesn't synchronize to the public version):

Screenshot from 2023-10-07 20-18-12-2

tail in the debug is defined like this:

'tail' => substr($result->getCss(), -200, 200)

and the debug is positioned above these three lines:

            $cache->set($cacheKey, $calculatedContentHash, ['scss'], 0);
            GeneralUtility::mkdir_deep(dirname(GeneralUtility::getFileAbsFileName($cssFilePath)));
            GeneralUtility::writeFile(GeneralUtility::getFileAbsFileName($cssFilePath), $result->getCss());

@DavidBruchmann
Copy link
Author

DavidBruchmann commented Oct 7, 2023

Finally I got a glimpse what's happening, there are indeed 2 different css files written, even I don't understand the reason.
Links in the page look always like this:

<link rel="stylesheet" href="/typo3temp/assets/compressed/main-b35a517bbfc96c1e9e1880dba255f20d.css?1696652233" media="all">

while the file /typo3temp/assets/css/sitepackage_xxx/main.css includes indeed the desired css including the sourcemap.

So the question is from admin perspective, either how to write in the file with dynamic name, or how to link to the file with static name.

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

1 participant