You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possibly related to #1042. I noticed this while running a build with Angular CLI (ng build --prod --source-map). I was able to reproduce the issue with clean-css-cli and have provided details below.
/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/apply-source-maps.js:72
metadata = scope[2][0];
^
TypeError: Cannot read property '0' of undefined
at findTokenSource (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/apply-source-maps.js:72:24)
at doApplySourceMaps (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/apply-source-maps.js:46:14)
at applySourceMaps (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/apply-source-maps.js:33:5)
at Object.callback (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:25:12)
at doInlineImports (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:200:25)
at inline (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:178:10)
at fromStyles (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:151:5)
at fromString (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:48:10)
at doReadSources (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:33:12)
at readSources (/Users/doug.ludlow/.npm/_npx/99367/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:24:10)
Possible solution
While debugging this issue, I found that code surrounded with /* clean-css ignore:<start|end> */ comments have a token type of raw (Token.RAW) and resemble a shape like this:
['raw','a { margin: 0px; }',[[1,28,undefined]]]
As such, the following line of code could probably be modified as follows:
However, I'm not exactly aware of the implications related to that associated change. Let me know if that change makes sense and if you'd like me to open a pull request.
The text was updated successfully, but these errors were encountered:
Hey @dougludlow - I have just pushed a fix based on your suggestion. That was it! Many thanks for debugging it to that point!
The change will land in v5 soon #1135
Sorry for not taking care of this patch earlier, but I'm catching up with clean-css maintenance only now.
Possibly related to #1042. I noticed this while running a build with Angular CLI (
ng build --prod --source-map
). I was able to reproduce the issue withclean-css-cli
and have provided details below.Environment
4.2.1
v10.16.2
Reproducible code
Error
Possible solution
While debugging this issue, I found that code surrounded with
/* clean-css ignore:<start|end> */
comments have a token type ofraw
(Token.RAW
) and resemble a shape like this:As such, the following line of code could probably be modified as follows:
https://github.com/jakubpawlowicz/clean-css/blob/3b2d0d23acf7582516a34f1f32e4dc84a830351a/lib/reader/apply-source-maps.js#L68
However, I'm not exactly aware of the implications related to that associated change. Let me know if that change makes sense and if you'd like me to open a pull request.
The text was updated successfully, but these errors were encountered: