plugin-sass icon indicating copy to clipboard operation
plugin-sass copied to clipboard

problem importing UTF-8 encoded files

Open tjaartvdwalt opened this issue 8 years ago • 6 comments

Hi, thank for a great plugin.

I get the following problem that I hope you can help me with. I want to use bourbon with my project. When I import the main sass file, I get the following exception:

system.src.js:122 Uncaught (in promise) Error: (SystemJS) Error: Invalid CSS after "3": expected "{", was ""
	        on line 37 of bourbon/bourbon/library/margin.scss
	>> 3
	   ^

In order to reproduce the error, I have created a small sample application: https://github.com/tjaartvdwalt/systemjs-sass-plugin-example

After some experimentation, it seems this error has to do with the fact that the file is UTF-8 encoded.

tjaartvdwalt avatar Nov 08 '16 00:11 tjaartvdwalt

Isn't everything UTF-8 encoded these days? But yea, I also have no idea how to get this plugin working.

// js
System.import('./styles/style.sass!');
// style.sass
@import 'jspm:bulma/bulma.sass'

results in

Uncaught (in promise) Error: (SystemJS) Error: Invalid CSS after "@charset": expected 1 selector or at-rule, was '"utf-8"'
	        on line 2 of http://localhost:8080/jspm_packages/npm/[email protected]/bulma.sass
	>> @charset "utf-8"
	   --------^

Ping @screendriver @sormy any ideas?

jgillich avatar Nov 28 '16 01:11 jgillich

Hi there,

thank you for the feedback. Yes it seems that @charset "UTF-8"; could not be interpreted as valid SASS. Unfortunately I can't do there anything (respectively I believe that 🤔 ). I parse all your input files as string and delegate everything to sass.js.

So I think we should open an issue there and see if there is anything we could do with the sass.js parser.

screendriver avatar Nov 29 '16 08:11 screendriver

Now that https://github.com/medialize/sass.js/issues/72 is resolved and released as part of 0.10.0, is this issue fixable/fixed? Would love to use this plugin, but bourbon is holding me back ;)

esbie avatar Jan 03 '17 18:01 esbie

This plugin is abandoned. Unfortunately we switched the technology and don't have the time and bugdet to maintain this plugin anymore.

I updated the README. However everyone can maintain this plugin furthermore (we would transfer the whole project to the user)

screendriver avatar Feb 13 '17 12:02 screendriver

I think all we need to do is update our version of sass.js here and then we can move forward, does that sound right?

dougludlow avatar Feb 25 '17 12:02 dougludlow

That's my understanding, yeah. Or if that doesn't fix the issue, there's a filesystem workaround as well.

esbie avatar Feb 27 '17 17:02 esbie