Closed jskorupski closed 8 years ago
Starting with lasso-less v 2.1.3, it appears that any inline JS breaks lasso-less. The error below, I believe, is caused by this line: https://github.com/madebysource/lesshat/blob/master/build/lesshat.less#L224
I'm guessing that the fixes for #16 caused this. Perhaps the code should just skip strings that begin with ~` ?
Full error (apologies for the length - I wanted to keep all error context for reference):
E16-05-13.15:47:11.748 [ERROR] [appmeta-service.findResourcesBatch_Error] Error &Async fragment failed (lasso-slot:body). Exception: Error: Error while writing bundle "lasso-less-base-grid-full (head, css)" Error: Error: Error compiling Less file (lasso.less:7825:8) - JavaScript evaluation error: Unexpected identifier from `(function(t){function e(t){var e,r,n,a,s,i,u,o,g= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,f="",d=[];if(!t)return t;do e=t.charCodeAt(c++), r=t.charCodeAt(c++),n=t.charCodeAt(c++),o=e<<16|r<<8|n,a=63&o>>18,s=63&o>>12,i=63&o>>6,u=63&o,d[l++]=g.charAt(a)+g.charAt(s)+ g.charAt(i)+g.charAt(u);while(c<t.length);f=d.join("");var p=t.length%3;return(p?f.slice(0,p-3):f)+"===".slice(p||3)} if(t=t||8121991,8121991==t)return t;var r=/linear|radial/g.test(t)&&t.split(/,(?=\s*(?:linear|radial|url))/g),n=[], a={"to bottom":'x1="0%" y1="0%" x2="0%" y2="100%"',"to left":'x1="100%" y1="0%" x2="0%" y2="0%"',"to top":'x1="0%" y1="100%" x2="0%" y2="0%"',"to right":'x1="0%" y1="0%" x2="100%" y2="0%"',get"top"(){return this["to bottom"]},get"180deg"() {return this["to bottom"]},get"right"(){return this["to left"]},get"270deg"(){return this["to left"]},get"bottom"() {return this["to top"]},get"90deg"(){return this["to right"]},get"0deg"(){return this["to top"]},get"left"() {return this["to right"]},"-45deg":'x1="0%" y1="0%" x2="100%" y2="100%"',"45deg":'x1="0%" y1="100%" x2="100%" y2="0%"', "ellipse at center":'cx="50%" cy="50%" r="75%"',get"135deg"(){return this["-45deg"]}},s={uri_data:"url(data:image/svg+xml;base64, ",xml:'<?xml version="1.0" ?>',svg_start:'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">',linear_gradient_start:'<linearGradient id="lesshat-generated" gradientUnits="userSpaceOnUse"', radial_gradient_start:'<radialGradient id="lesshat-generated" gradientUnits="userSpaceOnUse"',linear_gradient_end:"</linearGradient>", radial_gradient_end:"</radialGradient>",rect_linear:'<rect x="0" y="0" width="1" height="1" fill="url(#lesshat-generated)" />', rect_radial:'<rect x="-50" y="-50" width="101" height="101" fill="url(#lesshat-generated)" />',svg_end:"</svg>"};if(r.length) {r.forEach(function(t){var e={};if(Object.keys(a).some(function(r){return t.indexOf(r)>=0?(e.svg_direction=a[r],!0): (e.svg_direction=!1,void 0)}),/linear/.test(t))e.svg_type="linear";else if(/radial/.test(t))e.svg_type="radial";else if(!/linear/.test(t)&&!/radial/.test(t))return e.url=t.trim(),e.svg_type="url",e.svg_direction=!0,n.push(e),!1;var r=t.match(/rgb|#[a-zA-Z0-9]|hsl/g).length;e.svg_stops=[],t=t.replace(/transparent/g,"rgba(0,0,0,0)"),t.match(/#[a-zA-Z0-9]/g) &&t.match(/(#[a-zA-Z0-9]+)\s*(\d+%)?/g).forEach(function(t){t=t.split(" "),e.svg_stops.push('<stop offset="'+(t[1]||!1)+ '" stop-color="'+t[0]+'" stop-opacity="1"/>')}),t.match(/rgba?\(\d+,\s*\d+,\s*\d+(?:,\s*(0|1|\.\d+|0\.\d+))?\)/g)&& t.replace(/rgba?\((\d+,\s*\d+,\s*\d+)(?:,\s*(0|1|\.\d+|0\.\d+))?\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops .push('<stop offset="'+(a||!1)+'" stop-color="rgb('+r+')" stop-opacity="'+(n||1)+'"/>')}),t.match(/hsla?\((\d+,\s*\d+%,\s*\d+%), \s*(0|1|\.\d+|0\.\d+)\)/g)&&t.replace(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)\s*(\d+%)?/g,function(t,r,n,a) {e.svg_stops.push('<stop offset="'+(a||!1)+'" stop-color="hsl('+r+')" stop-opacity="'+(n||1)+'"/>')});var s=Math.floor(100/(r-1)); e.svg_stops.forEach(function(t,r){/offset="false"/.test(t)&&(e.svg_stops[r]=t.replace(/offset="false"/,'offset="'+s*r+'%"'))}), e.svg_stops.sort(function(t,e){return t=t.match(/offset="(\d+)%"/),e=e.match(/offset="(\d+)%"/),2==t.length&& 2==e.length?t[1]-e[1]:void 0}),n.push(e)});var i=[],u=n.every(function(t){for(var e in t)if(0==t[e]||0==t[e].length)return!1;return!0}); if(!u)return 8121991;n.forEach(function(t,e){("linear"==t.svg_type||"radial"==t.svg_type)&&(i[e]=s.xml+s.svg_start), "linear"==t.svg_type?(i[e]+=s.linear_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}), i[e]+=s.linear_gradient_end,i[e]+=s.rect_linear,i[e]+=s.svg_end):"radial"==t.svg_type?(i[e]+=s.radial_gradient_start+" "+ t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.radial_gradient_end,i[e]+=s.rect_radial,i[e]+=s.svg_end): "url"==t.svg_type&&(i[e]=t.url)}),i.forEach(function(t,r){/<\?xml version="1.0" \?>/g.test(t)&&(i[r]=s.uri_data+e(t)+")")}), t=i.join(",")}return t})((function(){var r="url("http://ir.ebaystatic.com/rs/v/syrjxipx1u1atby1mbuofmbhaqd.png")"return r=r.replace(/^\[|\]$/g,"")})())` at module.exports (/dev/project/node_modules/lasso/node_modules/raptor-util/createError.js:7:50) at done (/dev/project/node_modules/lasso/lib/writers/Writer.js:82:23) at /dev/project/node_modules/raptor-async/series.js:22:33 at handleError (/dev/project/node_modules/lasso/lib/writers/Writer.js:154:32) at /dev/project/node_modules/lasso/lib/writers/Writer.js:171:36 at CombinedStream.handleError (/dev/project/node_modules/lasso/lib/writers/file-writer.js:428:17) at emitOne (events.js:82:20) at CombinedStream.emit (events.js:169:7) at DeferredReadable.onError (/dev/project/node_modules/lasso/lib/util/CombinedStream.js:23:18) at emitOne (events.js:77:13) at DeferredReadable.emit (events.js:169:7) at DeferredReadable.emit (/dev/project/node_modules/lasso/lib/util/DeferredReadable.js:43:37) at DeferredReadable.<anonymous> (/dev/project/node_modules/lasso/lib/util/DeferredReadable.js:29:23) at emitOne (events.js:77:13) at DeferredReadable.emit (events.js:169:7) at DeferredReadable.emit (/dev/project/node_modules/lasso/lib/util/DeferredReadable.js:43:37) at DeferredReadable.handleError (/dev/project/node_modules/lasso/lib/transforms.js:78:32) at emitOne (events.js:77:13) at DeferredReadable.emit (events.js:169:7) at DeferredReadable.emit (/dev/project/node_modules/lasso/lib/util/DeferredReadable.js:43:37) at callback (/dev/project/node_modules/lasso/lib/util/index.js:63:24) at errorCallback (/dev/project/node_modules/lasso-less/src/dependency-less.js:76:17) Caused by: Error: Error compiling Less file (lasso.less:7825:8) - JavaScript evaluation error: Unexpected identifier from `(function(t){function e(t){var e,r,n,a,s,i,u,o,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,f="",d=[];if(!t)return t;do e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),o=e<<16|r<<8|n,a=63&o>>18,s=63&o>>12,i=63&o>>6,u=63&o,d[l++]=g.charAt(a)+g.charAt(s)+g.charAt(i)+g.charAt(u);while(c<t.length);f=d.join("");var p=t.length%3;return(p?f.slice(0,p-3):f)+"===".slice(p||3)}if(t=t||8121991,8121991==t)return t;var r=/linear|radial/g.test(t)&&t.split(/,(?=\s*(?:linear|radial|url))/g),n=[],a={"to bottom":'x1="0%" y1="0%" x2="0%" y2="100%"',"to left":'x1="100%" y1="0%" x2="0%" y2="0%"',"to top":'x1="0%" y1="100%" x2="0%" y2="0%"',"to right":'x1="0%" y1="0%" x2="100%" y2="0%"',get"top"(){return this["to bottom"]},get"180deg"(){return this["to bottom"]},get"right"(){return this["to left"]},get"270deg"(){return this["to left"]},get"bottom"(){return this["to top"]},get"90deg"(){return this["to right"]},get"0deg"(){return this["to top"]},get"left"(){return this["to right"]},"-45deg":'x1="0%" y1="0%" x2="100%" y2="100%"',"45deg":'x1="0%" y1="100%" x2="100%" y2="0%"',"ellipse at center":'cx="50%" cy="50%" r="75%"',get"135deg"(){return this["-45deg"]}},s={uri_data:"url(data:image/svg+xml;base64,",xml:'<?xml version="1.0" ?>',svg_start:'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">',linear_gradient_start:'<linearGradient id="lesshat-generated" gradientUnits="userSpaceOnUse"',radial_gradient_start:'<radialGradient id="lesshat-generated" gradientUnits="userSpaceOnUse"',linear_gradient_end:"</linearGradient>",radial_gradient_end:"</radialGradient>",rect_linear:'<rect x="0" y="0" width="1" height="1" fill="url(#lesshat-generated)" />',rect_radial:'<rect x="-50" y="-50" width="101" height="101" fill="url(#lesshat-generated)" />',svg_end:"</svg>"};if(r.length){r.forEach(function(t){var e={};if(Object.keys(a).some(function(r){return t.indexOf(r)>=0?(e.svg_direction=a[r],!0):(e.svg_direction=!1,void 0)}),/linear/.test(t))e.svg_type="linear";else if(/radial/.test(t))e.svg_type="radial";else if(!/linear/.test(t)&&!/radial/.test(t))return e.url=t.trim(),e.svg_type="url",e.svg_direction=!0,n.push(e),!1;var r=t.match(/rgb|#[a-zA-Z0-9]|hsl/g).length;e.svg_stops=[],t=t.replace(/transparent/g,"rgba(0,0,0,0)"),t.match(/#[a-zA-Z0-9]/g)&&t.match(/(#[a-zA-Z0-9]+)\s*(\d+%)?/g).forEach(function(t){t=t.split(" "),e.svg_stops.push('<stop offset="'+(t[1]||!1)+'" stop-color="'+t[0]+'" stop-opacity="1"/>')}),t.match(/rgba?\(\d+,\s*\d+,\s*\d+(?:,\s*(0|1|\.\d+|0\.\d+))?\)/g)&&t.replace(/rgba?\((\d+,\s*\d+,\s*\d+)(?:,\s*(0|1|\.\d+|0\.\d+))?\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('<stop offset="'+(a||!1)+'" stop-color="rgb('+r+')" stop-opacity="'+(n||1)+'"/>')}),t.match(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)/g)&&t.replace(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('<stop offset="'+(a||!1)+'" stop-color="hsl('+r+')" stop-opacity="'+(n||1)+'"/>')});var s=Math.floor(100/(r-1));e.svg_stops.forEach(function(t,r){/offset="false"/.test(t)&&(e.svg_stops[r]=t.replace(/offset="false"/,'offset="'+s*r+'%"'))}),e.svg_stops.sort(function(t,e){return t=t.match(/offset="(\d+)%"/),e=e.match(/offset="(\d+)%"/),2==t.length&&2==e.length?t[1]-e[1]:void 0}),n.push(e)});var i=[],u=n.every(function(t){for(var e in t)if(0==t[e]||0==t[e].length)return!1;return!0});if(!u)return 8121991;n.forEach(function(t,e){("linear"==t.svg_type||"radial"==t.svg_type)&&(i[e]=s.xml+s.svg_start),"linear"==t.svg_type?(i[e]+=s.linear_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.linear_gradient_end,i[e]+=s.rect_linear,i[e]+=s.svg_end):"radial"==t.svg_type?(i[e]+=s.radial_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.radial_gradient_end,i[e]+=s.rect_radial,i[e]+=s.svg_end):"url"==t.svg_type&&(i[e]=t.url)}),i.forEach(function(t,r){/<\?xml version="1.0" \?>/g.test(t)&&(i[r]=s.uri_data+e(t)+")")}),t=i.join(",")}return t})((function(){var r="url("http://ir.ebaystatic.com/rs/v/syrjxipx1u1atby1mbuofmbhaqd.png")";return r=r.replace(/^\[|\]$/g,"")})())` at renderCallback (/dev/project/node_modules/lasso-less/src/dependency-less.js:87:35) at /dev/project/node_modules/lasso-less/node_modules/less/lib/less/render.js:33:38 at /dev/project/node_modules/lasso-less/node_modules/less/lib/less/parse.js:63:17 at Object.finish [as _finish] (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/parser/parser.js:183:28) at Object.ImportVisitor._onSequencerEmpty (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/visitors/import-visitor.js:35:14) at ImportSequencer.tryRun (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/visitors/import-sequencer.js:50:14) at Object.ImportVisitor.run (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/visitors/import-visitor.js:29:25) at Object.Parser.parse (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/parser/parser.js:189:22) at Object.parse (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/parse.js:61:18) at Object.render (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/render.js:25:18) at /dev/project/node_modules/lasso-less/src/dependency-less.js:130:22 at /dev/project/node_modules/lasso-less/src/util/less-loader.js:231:9 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:251:17 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:154:25 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:248:21 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:612:34 at /dev/project/node_modules/lasso-less/src/util/less-loader.js:214:25 at /dev/project/node_modules/lasso-less/src/util/less-loader.js:188:17 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:251:17 at done (/dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:132:19) at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:32:16 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:248:21=Error: Async fragment failed (lasso-slot:body). Exception: Error: Error while writing bundle "lasso-less-base-grid-full (head, css)" Error: Error: Error compiling Less file (lasso.less:7825:8) - JavaScript evaluation error: Unexpected identifier from `(function(t){function e(t){var e,r,n,a,s,i,u,o,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,f="",d=[];if(!t)return t;do e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),o=e<<16|r<<8|n,a=63&o>>18,s=63&o>>12,i=63&o>>6,u=63&o,d[l++]=g.charAt(a)+g.charAt(s)+g.charAt(i)+g.charAt(u);while(c<t.length);f=d.join("");var p=t.length%3;return(p?f.slice(0,p-3):f)+"===".slice(p||3)}if(t=t||8121991,8121991==t)return t;var r=/linear|radial/g.test(t)&&t.split(/,(?=\s*(?:linear|radial|url))/g),n=[],a={"to bottom":'x1="0%" y1="0%" x2="0%" y2="100%"',"to left":'x1="100%" y1="0%" x2="0%" y2="0%"',"to top":'x1="0%" y1="100%" x2="0%" y2="0%"',"to right":'x1="0%" y1="0%" x2="100%" y2="0%"',get"top"(){return this["to bottom"]},get"180deg"(){return this["to bottom"]},get"right"(){return this["to left"]},get"270deg"(){return this["to left"]},get"bottom"(){return this["to top"]},get"90deg"(){return this["to right"]},get"0deg"(){return this["to top"]},get"left"(){return this["to right"]},"-45deg":'x1="0%" y1="0%" x2="100%" y2="100%"',"45deg":'x1="0%" y1="100%" x2="100%" y2="0%"',"ellipse at center":'cx="50%" cy="50%" r="75%"',get"135deg"(){return this["-45deg"]}},s={uri_data:"url(data:image/svg+xml;base64,",xml:'<?xml version="1.0" ?>',svg_start:'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">',linear_gradient_start:'<linearGradient id="lesshat-generated" gradientUnits="userSpaceOnUse"',radial_gradient_start:'<radialGradient id="lesshat-generated" gradientUnits="userSpaceOnUse"',linear_gradient_end:"</linearGradient>",radial_gradient_end:"</radialGradient>",rect_linear:'<rect x="0" y="0" width="1" height="1" fill="url(#lesshat-generated)" />',rect_radial:'<rect x="-50" y="-50" width="101" height="101" fill="url(#lesshat-generated)" />',svg_end:"</svg>"};if(r.length){r.forEach(function(t){var e={};if(Object.keys(a).some(function(r){return t.indexOf(r)>=0?(e.svg_direction=a[r],!0):(e.svg_direction=!1,void 0)}),/linear/.test(t))e.svg_type="linear";else if(/radial/.test(t))e.svg_type="radial";else if(!/linear/.test(t)&&!/radial/.test(t))return e.url=t.trim(),e.svg_type="url",e.svg_direction=!0,n.push(e),!1;var r=t.match(/rgb|#[a-zA-Z0-9]|hsl/g).length;e.svg_stops=[],t=t.replace(/transparent/g,"rgba(0,0,0,0)"),t.match(/#[a-zA-Z0-9]/g)&&t.match(/(#[a-zA-Z0-9]+)\s*(\d+%)?/g).forEach(function(t){t=t.split(" "),e.svg_stops.push('<stop offset="'+(t[1]||!1)+'" stop-color="'+t[0]+'" stop-opacity="1"/>')}),t.match(/rgba?\(\d+,\s*\d+,\s*\d+(?:,\s*(0|1|\.\d+|0\.\d+))?\)/g)&&t.replace(/rgba?\((\d+,\s*\d+,\s*\d+)(?:,\s*(0|1|\.\d+|0\.\d+))?\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('<stop offset="'+(a||!1)+'" stop-color="rgb('+r+')" stop-opacity="'+(n||1)+'"/>')}),t.match(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)/g)&&t.replace(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('<stop offset="'+(a||!1)+'" stop-color="hsl('+r+')" stop-opacity="'+(n||1)+'"/>')});var s=Math.floor(100/(r-1));e.svg_stops.forEach(function(t,r){/offset="false"/.test(t)&&(e.svg_stops[r]=t.replace(/offset="false"/,'offset="'+s*r+'%"'))}),e.svg_stops.sort(function(t,e){return t=t.match(/offset="(\d+)%"/),e=e.match(/offset="(\d+)%"/),2==t.length&&2==e.length?t[1]-e[1]:void 0}),n.push(e)});var i=[],u=n.every(function(t){for(var e in t)if(0==t[e]||0==t[e].length)return!1;return!0});if(!u)return 8121991;n.forEach(function(t,e){("linear"==t.svg_type||"radial"==t.svg_type)&&(i[e]=s.xml+s.svg_start),"linear"==t.svg_type?(i[e]+=s.linear_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.linear_gradient_end,i[e]+=s.rect_linear,i[e]+=s.svg_end):"radial"==t.svg_type?(i[e]+=s.radial_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.radial_gradient_end,i[e]+=s.rect_radial,i[e]+=s.svg_end):"url"==t.svg_type&&(i[e]=t.url)}),i.forEach(function(t,r){/<\?xml version="1.0" \?>/g.test(t)&&(i[r]=s.uri_data+e(t)+")")}),t=i.join(",")}return t})((function(){var r="url("http://ir.ebaystatic.com/rs/v/syrjxipx1u1atby1mbuofmbhaqd.png")";return r=r.replace(/^\[|\]$/g,"")})())` at module.exports (/dev/project/node_modules/lasso/node_modules/raptor-util/createError.js:7:50) at done (/dev/project/node_modules/lasso/lib/writers/Writer.js:82:23) at /dev/project/node_modules/raptor-async/series.js:22:33 at handleError (/dev/project/node_modules/lasso/lib/writers/Writer.js:154:32) at /dev/project/node_modules/lasso/lib/writers/Writer.js:171:36 at CombinedStream.handleError (/dev/project/node_modules/lasso/lib/writers/file-writer.js:428:17) at emitOne (events.js:82:20) at CombinedStream.emit (events.js:169:7) at DeferredReadable.onError (/dev/project/node_modules/lasso/lib/util/CombinedStream.js:23:18) at emitOne (events.js:77:13) at DeferredReadable.emit (events.js:169:7) at DeferredReadable.emit (/dev/project/node_modules/lasso/lib/util/DeferredReadable.js:43:37) at DeferredReadable.<anonymous> (/dev/project/node_modules/lasso/lib/util/DeferredReadable.js:29:23) at emitOne (events.js:77:13) at DeferredReadable.emit (events.js:169:7) at DeferredReadable.emit (/dev/project/node_modules/lasso/lib/util/DeferredReadable.js:43:37) at DeferredReadable.handleError (/dev/project/node_modules/lasso/lib/transforms.js:78:32) at emitOne (events.js:77:13) at DeferredReadable.emit (events.js:169:7) at DeferredReadable.emit (/dev/project/node_modules/lasso/lib/util/DeferredReadable.js:43:37) at callback (/dev/project/node_modules/lasso/lib/util/index.js:63:24) at errorCallback (/dev/project/node_modules/lasso-less/src/dependency-less.js:76:17) Caused by: Error: Error compiling Less file (lasso.less:7825:8) - JavaScript evaluation error: Unexpected identifier from `(function(t){function e(t){var e,r,n,a,s,i,u,o,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,f="",d=[];if(!t)return t;do e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),o=e<<16|r<<8|n,a=63&o>>18,s=63&o>>12,i=63&o>>6,u=63&o,d[l++]=g.charAt(a)+g.charAt(s)+g.charAt(i)+g.charAt(u);while(c<t.length);f=d.join("");var p=t.length%3;return(p?f.slice(0,p-3):f)+"===".slice(p||3)}if(t=t||8121991,8121991==t)return t;var r=/linear|radial/g.test(t)&&t.split(/,(?=\s*(?:linear|radial|url))/g),n=[],a={"to bottom":'x1="0%" y1="0%" x2="0%" y2="100%"',"to left":'x1="100%" y1="0%" x2="0%" y2="0%"',"to top":'x1="0%" y1="100%" x2="0%" y2="0%"',"to right":'x1="0%" y1="0%" x2="100%" y2="0%"',get"top"(){return this["to bottom"]},get"180deg"(){return this["to bottom"]},get"right"(){return this["to left"]},get"270deg"(){return this["to left"]},get"bottom"(){return this["to top"]},get"90deg"(){return this["to right"]},get"0deg"(){return this["to top"]},get"left"(){return this["to right"]},"-45deg":'x1="0%" y1="0%" x2="100%" y2="100%"',"45deg":'x1="0%" y1="100%" x2="100%" y2="0%"',"ellipse at center":'cx="50%" cy="50%" r="75%"',get"135deg"(){return this["-45deg"]}},s={uri_data:"url(data:image/svg+xml;base64,",xml:'<?xml version="1.0" ?>',svg_start:'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">',linear_gradient_start:'<linearGradient id="lesshat-generated" gradientUnits="userSpaceOnUse"',radial_gradient_start:'<radialGradient id="lesshat-generated" gradientUnits="userSpaceOnUse"',linear_gradient_end:"</linearGradient>",radial_gradient_end:"</radialGradient>",rect_linear:'<rect x="0" y="0" width="1" height="1" fill="url(#lesshat-generated)" />',rect_radial:'<rect x="-50" y="-50" width="101" height="101" fill="url(#lesshat-generated)" />',svg_end:"</svg>"};if(r.length){r.forEach(function(t){var e={};if(Object.keys(a).some(function(r){return t.indexOf(r)>=0?(e.svg_direction=a[r],!0):(e.svg_direction=!1,void 0)}),/linear/.test(t))e.svg_type="linear";else if(/radial/.test(t))e.svg_type="radial";else if(!/linear/.test(t)&&!/radial/.test(t))return e.url=t.trim(),e.svg_type="url",e.svg_direction=!0,n.push(e),!1;var r=t.match(/rgb|#[a-zA-Z0-9]|hsl/g).length;e.svg_stops=[],t=t.replace(/transparent/g,"rgba(0,0,0,0)"),t.match(/#[a-zA-Z0-9]/g)&&t.match(/(#[a-zA-Z0-9]+)\s*(\d+%)?/g).forEach(function(t){t=t.split(" "),e.svg_stops.push('<stop offset="'+(t[1]||!1)+'" stop-color="'+t[0]+'" stop-opacity="1"/>')}),t.match(/rgba?\(\d+,\s*\d+,\s*\d+(?:,\s*(0|1|\.\d+|0\.\d+))?\)/g)&&t.replace(/rgba?\((\d+,\s*\d+,\s*\d+)(?:,\s*(0|1|\.\d+|0\.\d+))?\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('<stop offset="'+(a||!1)+'" stop-color="rgb('+r+')" stop-opacity="'+(n||1)+'"/>')}),t.match(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)/g)&&t.replace(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('<stop offset="'+(a||!1)+'" stop-color="hsl('+r+')" stop-opacity="'+(n||1)+'"/>')});var s=Math.floor(100/(r-1));e.svg_stops.forEach(function(t,r){/offset="false"/.test(t)&&(e.svg_stops[r]=t.replace(/offset="false"/,'offset="'+s*r+'%"'))}),e.svg_stops.sort(function(t,e){return t=t.match(/offset="(\d+)%"/),e=e.match(/offset="(\d+)%"/),2==t.length&&2==e.length?t[1]-e[1]:void 0}),n.push(e)});var i=[],u=n.every(function(t){for(var e in t)if(0==t[e]||0==t[e].length)return!1;return!0});if(!u)return 8121991;n.forEach(function(t,e){("linear"==t.svg_type||"radial"==t.svg_type)&&(i[e]=s.xml+s.svg_start),"linear"==t.svg_type?(i[e]+=s.linear_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.linear_gradient_end,i[e]+=s.rect_linear,i[e]+=s.svg_end):"radial"==t.svg_type?(i[e]+=s.radial_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.radial_gradient_end,i[e]+=s.rect_radial,i[e]+=s.svg_end):"url"==t.svg_type&&(i[e]=t.url)}),i.forEach(function(t,r){/<\?xml version="1.0" \?>/g.test(t)&&(i[r]=s.uri_data+e(t)+")")}),t=i.join(",")}return t})((function(){var r="url("http://ir.ebaystatic.com/rs/v/syrjxipx1u1atby1mbuofmbhaqd.png")";return r=r.replace(/^\[|\]$/g,"")})())` at renderCallback (/dev/project/node_modules/lasso-less/src/dependency-less.js:87:35) at /dev/project/node_modules/lasso-less/node_modules/less/lib/less/render.js:33:38 at /dev/project/node_modules/lasso-less/node_modules/less/lib/less/parse.js:63:17 at Object.finish [as _finish] (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/parser/parser.js:183:28) at Object.ImportVisitor._onSequencerEmpty (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/visitors/import-visitor.js:35:14) at ImportSequencer.tryRun (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/visitors/import-sequencer.js:50:14) at Object.ImportVisitor.run (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/visitors/import-visitor.js:29:25) at Object.Parser.parse (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/parser/parser.js:189:22) at Object.parse (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/parse.js:61:18) at Object.render (/dev/project/node_modules/lasso-less/node_modules/less/lib/less/render.js:25:18) at /dev/project/node_modules/lasso-less/src/dependency-less.js:130:22 at /dev/project/node_modules/lasso-less/src/util/less-loader.js:231:9 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:251:17 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:154:25 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:248:21 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:612:34 at /dev/project/node_modules/lasso-less/src/util/less-loader.js:214:25 at /dev/project/node_modules/lasso-less/src/util/less-loader.js:188:17 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:251:17 at done (/dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:132:19) at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:32:16 at /dev/project/node_modules/lasso-less/node_modules/async/lib/async.js:248:21 at DustAsyncWriter.AsyncWriter.error (/dev/project/node_modules/raptor-dust/node_modules/async-writer/lib/AsyncWriter.js:423:17) at Object.<anonymous> (/dev/project/node_modules/lasso/taglib/slot-tag.js:66:30) at bound (domain.js:280:14) at Object.runBound (domain.js:293:12) at notifyCallbacks (/dev/project/node_modules/raptor-async/AsyncValue.js:76:35) at Object.AsyncValue.reject (/dev/project/node_modules/raptor-async/AsyncValue.js:240:9) at done (/dev/project/node_modules/lasso/taglib/page-tag.js:65:39) at done (/dev/project/node_modules/lasso/lib/Lasso.js:684:21) at /dev/project/node_modules/lasso/node_modules/raptor-cache/lib/Cache.js:273:24 at builderCallback (/dev/project/node_modules/lasso/node_modules/raptor-cache/lib/Cache.js:131:25) at /dev/project/node_modules/lasso/lib/Lasso.js:289:24 at /dev/project/node_modules/raptor-async/series.js:22:33 at /dev/project/node_modules/raptor-async/series.js:22:33 at done (/dev/project/node_modules/lasso/lib/writers/Writer.js:83:24) at /dev/project/node_modules/raptor-async/series.js:22:33 at handleError (/dev/project/node_modules/lasso/lib/writers/Writer.js:154:32) at /dev/project/node_modules/lasso/lib/writers/Writer.js:171:36 at CombinedStream.handleError (/dev/project/node_modules/lasso/lib/writers/file-writer.js:428:17) at emitOne (events.js:82:20) at CombinedStream.emit (events.js:169:7) at DeferredReadable.onError (/dev/project/node_modules/lasso/lib/util/CombinedStream.js:23:18) at emitOne (events.js:77:13) 1
I think you are right. I'm taking a look. Thanks for reporting the problem
New version published: lasso-less@2.2.2
lasso-less@2.2.2
Please let me know if you still see issues. Thanks.
Starting with lasso-less v 2.1.3, it appears that any inline JS breaks lasso-less. The error below, I believe, is caused by this line: https://github.com/madebysource/lesshat/blob/master/build/lesshat.less#L224
I'm guessing that the fixes for #16 caused this. Perhaps the code should just skip strings that begin with ~` ?
Full error (apologies for the length - I wanted to keep all error context for reference):