Cannot read property 'line' of undefined at originalPosition in gulp-clean-css plugin

[亡魂溺海] 提交于 2019-12-10 10:52:00

问题


As mentioned in the question, when I launch gulp build I get the following error:

C:\dev\work\viewAngular\web\node_modules\gulp-clean-css\node_modules\clean-css\lib\reader\input-source-map-tracker.js:37
if (originalPosition.line === null && line > 1 && selectorFallbacks > 0) {
                    ^
TypeError: Cannot read property 'line' of undefined
    at originalPosition 
    For (C:\dev\work\viewAngular\web\node_modules\gulp-clean-css\node_modules\clean-css\lib\reader\input-source-map-tracker.js:37:23)

I dont know where this is coming up from since I didn't make any changes to gulp-clean-css files or anything related.

I also launched multiple times: bower update, bower install, npm install.


回答1:


I got the same problem. My issue was that I had a devDependencies like this:

 "devDependencies": {
    ...
    "gulp-clean-css": "^2.0.3",
    ...
 }

This bumped gulp-clean-cssto version 2.4.0 which crashed my build. Removing the ^ forced the older version and made my build run again.

Now it's time up upgrade my dependencies, but at least I know what was failing...



来源:https://stackoverflow.com/questions/43494864/cannot-read-property-line-of-undefined-at-originalposition-in-gulp-clean-css-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!