Invalid CSS after "*": expected "{", was "input, textarea..."
dsandstrom opened this issue · comments
I'm getting a weird error when using RSpec's render_views
in my controller tests.
Failure/Error: <%= stylesheet_link_tag "application" %>
ActionView::Template::Error:
Invalid CSS after "*": expected "{", was "input, textarea..."
"input" may only be used at the beginning of a compound selector.
# (sass):30
# ./app/views/layouts/application.html.erb:9:in `_app_views_layouts_application_html_erb__2528527600054665895_70287569651860'
# ./spec/controllers/posts_controller_spec.rb:57:in `block (5 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Sass::SyntaxError:
# Invalid CSS after "*": expected "{", was "input, textarea..."
#
# "input" may only be used at the beginning of a compound selector.
# (sass):30
I can't figure what is causing the error so I don't know if this is right spot to post an issue. I tried disabling any gems that were adding CSS and blanking out my application.css file, the error still exists. I can fix the error by removing the stylesheet_link_tag
. Also, I can fix the error by using sass-rails v4.0.5, however Foundation 6 doesn't work with this version of sass. The error persists in v6.0.0.beta1.
User error, sorry for the noise.
Hi I am having a similar issue. Can you tell me what the cause of the issue was?
@jaehocho I don't exactly remember. I think it was a syntax error in one of my files or something I was including. Sorry, I should have posted more info at the time.
Edit:
Found the commit
-*input, textarea, select {
+input, textarea, select {
Looks like I had *input
for some reason.
@dsandstrom Thanks for the reply. My issue was due to similar syntax error in a CSS file
I had trouble narrowing down and found somewhere that putting puts statement in SCSS parser can show the source of the issue:
So in this file:
/usr/share/rvm/gems/ruby-2.4.2@rails-5/gems/sass-3.5.6/lib/sass/scss/parser.rb"
I added the following puts stmt and was able to narrow down to the issue.
def initialize(str, filename, importer, line = 1, offset = 1)
puts "filename: #{filename}"
puts "str: #{str}"