Re: [wro4j] Css UrlRewriting Not Working

56 views
Skip to first unread message

alex.o...@gmail.com

unread,
May 21, 2015, 1:21:40 PM5/21/15
to wr...@googlegroups.com, wr...@googlegroups.com
Hi,

It seems the processed resource does not have a valid sass syntax. It has nothing to do with cssUrlRewriting processor because of their order (sass is before the cssUrlRewriting). 

Could you provide an example of the resource being processed?

Alex


Sent from Mailbox


On Thu, May 21, 2015 at 8:09 PM, johnny...@gmail.com <johnny...@gmail.com> wrote:

Hi

I am trying to rewtite the image urls in my css file.

I use the maven plugin

My properties file is as follows

preProcessors=cssVariables,cssImport,semicolonAppender,rubySassCss.scss,cssUrlRewriting
postProcessors=cssMinJawr

When i include cssUrlRewriting  I get the following error
[INFO] processing group: main.css
Sass::SyntaxError: Invalid CSS after "  }": expected selector or at-rule, was "}
"
  expected at C:/Users/user/.m2/repository/me/n4u/sass/sass-gems/3.2.1/sass-g
ems-3.2.1.jar!/gems/sass-3.2.1/lib/sass/scss/parser.rb:1129
  expected at C:/Users/user/.m2/repository/me/n4u/sass/sass-gems/3.2.1/sass-g
ems-3.2.1.jar!/gems/sass-3.2.1/lib/sass/scss/parser.rb:1066
     parse at C:/Users/user/.m2/repository/me/n4u/sass/sass-gems/3.2.1/sass-g
ems-3.2.1.jar!/gems/sass-3.2.1/lib/sass/scss/parser.rb:28
  _to_tree at C:/Users/user/.m2/repository/me/n4u/sass/sass-gems/3.2.1/sass-g
ems-3.2.1.jar!/gems/sass-3.2.1/lib/sass/engine.rb:342
   _render at C:/Users/user/.m2/repository/me/n4u/sass/sass-gems/3.2.1/sass-g
ems-3.2.1.jar!/gems/sass-3.2.1/lib/sass/engine.rb:315
    render at C:/Users/user/.m2/repository/me/n4u/sass/sass-gems/3.2.1/sass-g
ems-3.2.1.jar!/gems/sass-3.2.1/lib/sass/engine.rb:262
    (root) at <script>:4

Any idea whats up?

--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at http://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/d/optout.

johnny...@gmail.com

unread,
May 21, 2015, 1:53:15 PM5/21/15
to wr...@googlegroups.com
Hi Alex

Sure

Please see the attached files - I have trimmed down for the purposes of this test and the error is still thrown

Thank you
Johnny
demo.rar

johnny...@gmail.com

unread,
May 21, 2015, 1:09:36 PM5/21/15
to wr...@googlegroups.com

Alex Objelean

unread,
May 22, 2015, 4:54:51 AM5/22/15
to wr...@googlegroups.com, johnny...@gmail.com, johnny...@gmail.com
Hi Johnny,

I'm unable to process the provided sass resources, because it requires variables defined in resources which are not part of the archive you have attached in your previous email.

Ideally, you should isolate the problem to a single sass statement (or as less as possible). You could send the isolated resource or, even better, create an example project (github or anywhere else) where I could easily reproduce the problem.

Another thought, are you sure the syntax is valid one? Have you validated it using online sass transformers?

Cheers,
Alex

Damien Gallagher

unread,
May 22, 2015, 7:48:29 AM5/22/15
to wr...@googlegroups.com, johnny...@gmail.com
Hi Alex

I believe the sass is valid  as it compiles when I use the sass-maven-plugin 

Cheers
Johnny

alex.o...@gmail.com

unread,
May 22, 2015, 7:52:57 AM5/22/15
to wr...@googlegroups.com, wr...@googlegroups.com, johnny...@gmail.com
Hi Johnny,

Could you identify the smallest part of the code which presumably offend the sass processor?

Also, could you try removing other processors just to ensure these do not influence the processing result?

Thanks,
Alex


Sent from Mailbox

Damien Gallagher

unread,
May 22, 2015, 9:27:44 AM5/22/15
to wr...@googlegroups.com, johnny...@gmail.com
Hi Alex

I will try this over the weekend if i get a chance -we reference alot of css files

When I use this it works fine
preProcessors=cssImport,rubySassCss.scss

When I add the processor, cssUrlRewriting - that is when I get the problems
preProcessors=cssImport,rubySassCss.scss,cssUrlRewriting

If the sass files were not valid, should rubySassCss not pick up on this?

Thanks
Johnny

Alex Objelean

unread,
May 22, 2015, 10:05:57 AM5/22/15
to wr...@googlegroups.com
In order to ignore a failing processor, the following configuration should be added:
ignoreFailingProcessor=true

A couple more suggestions:
1) add cssUrlRewriting before rubySassCss processor. 
2) Apply cssUrlRewriting only on resources with css extension (using preprocessors=cssUrlRewriting.css).

I think  of a couple of possible causes, but cannot confirm unless I can reproduce the issue. 

Thanks,
Alex

johnny...@gmail.com

unread,
May 22, 2015, 10:37:30 AM5/22/15
to wr...@googlegroups.com
Hi Alex

I tried the second option and it worked fine
However my css doesnt render properly

I ran the generated css through a css validator online and problems were found

I will need to go through my sass  files and see can I resolve those issues

Thanks for your help on this

Cheers
Damien
Reply all
Reply to author
Forward
0 new messages