dougludlow / plugin-sass

SystemJS SASS loader plugin
MIT License
52 stars 27 forks source link

Code crashes on missing endsWith #67

Closed nelisbijl closed 8 years ago

nelisbijl commented 8 years ago

Potentially unhandled rejection 3 TypeError: Object doesn't support property or method 'endsWith'

This is in sass-inject: const indentedSyntax = load.address.endsWith('.sass');

nelisbijl commented 8 years ago

Solved this by adding the following to SystemJS.config meta section:

"scss": { "deps": [ "babel/browser-polyfill.js" ]
},

Q1: is this a proprer solution? Q2: why does this package not include the proper dependency?

screendriver commented 8 years ago

Which Browser (and version) do you use? .endsWith() should be supported by all modern browsers.

By the way: as a general rule of thumb you should always import the Babel polyfill as described here at the very first beginning of your scripts. With the polyfill you ensure that all plugins, code, runtimes are working as expected.

nelisbijl commented 8 years ago

Ok, using the polyfill