This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | @import at top of .scss produces "unexpected token IMPORT_SYM found" | ||
---|---|---|---|
Product: | web | Reporter: | beany |
Component: | CSS Editor | Assignee: | Milutin Kristofic <mkristofic> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | vriha |
Priority: | P3 | ||
Version: | 8.0.1 | ||
Hardware: | PC | ||
OS: | Windows 8 x64 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Wrong hint shown
Wrong hint is NOT shown if there's some CSS class above the @import IDE log + sample file |
Created attachment 149856 [details]
Wrong hint is NOT shown if there's some CSS class above the @import
I'm sorry but it works for me. Could you please attach the file and IDE log (see http://wiki.netbeans.org/FaqLogMessagesFile ) ? Perhaps there is some non-printable character or something. Thank you Product Version: NetBeans IDE 8.0.1 (Build 201408251540) Updates: NetBeans IDE is updated to version NetBeans 8.0.1 Patch 1.1 Java: 1.8.0_25; Java HotSpot(TM) Client VM 25.25-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b17 System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb) Created attachment 149861 [details]
IDE log + sample file
Log and file attached in a password protected file. Password jdk9393
Thank you, the problem seems to be encoding of the file, UTF-8 with BOM which is afaik not supported in NetBeans (see issue 161015). I'm on linux and IDE displays a "empty space" right before beginning of the comment on line 1. What seems to work for me is to e.g. delete first few characters at the beginning of line 1 and type them again. Or save the file with different encoding which could though cause weird/incorrect characters - in my case there was ? mark before the beginning of the comment. *** This bug has been marked as a duplicate of bug 161015 *** Thanks for explaining. Problem is that when compiling SASS that is not UTF8+BOM, instead of adding @charset "UTF-8"; at the top of the resulting .CSS, it adds @charset "IBM437"; and even trying to have the directive inside the .scss doesn't help. As this is a bug in NetBeans, the meanwhile workaround for me was to add .dummy{} /* Dummy needed due to NetBeans bug - to be removed */ at the top of the class which for some reason makes all error disappear. I personally didn't see any ? Files were converted to UTF8+BOM using Notepad++ Thanks (In reply to beany from comment #5) > Thanks for explaining. Problem is that when compiling SASS that is not > UTF8+BOM, instead of adding > @charset "UTF-8"; > > at the top of the resulting .CSS, it adds > > @charset "IBM437"; > > and even trying to have the directive inside the .scss doesn't help. > I'm sorry, how the files is compiled is up to the Sass compiler (https://github.com/sass/sass). I don't know how it handles UTF-8 BOM. Maybe it has some command line parameter, if so you can then add it in NetBeans in project properties. > As this is a bug in NetBeans, the meanwhile workaround for me was to add > .dummy{} /* Dummy needed due to NetBeans bug - to be removed */ > at the top of the class which for some reason makes all error disappear. > > I personally didn't see any ? > > Files were converted to UTF8+BOM using Notepad++ > I'm not expert on encoding, but I guess ? could happen only when encoding to some encoding. Another "workaround" would be not to use UTF-8 BOM unless it is necessary I left the additional info as a temp workaround for those who might face the same situation. When NetBeans get the UTF8+BOM bug fixed, it'll resolve the matter. SASS compliation was done using Koala on Windows8. It handles any encoding well but adds the @charset based on the file's encoding. Thank you for marking the relevant duplicate and I hope it'll be resolved soon. |
Created attachment 149855 [details] Wrong hint shown NetBeans produces an undeserved parsing error when it finds @import at the top of a .scss file and produces an irrelevant. Adding a dummy empty CSS class above it makes this disappear. See screen shots of editing a simple .scss file in NetBeans8.0.1