Code Monkey home page Code Monkey logo

Comments (14)

lautis avatar lautis commented on May 25, 2024

This error is thrown from inside UglifyJS. For some reason, it doesn't like your JS.

To solve this issue,

  1. Would it be possible to see the JS code (or some narrowed down example) causing this?
  2. Could you try the latest master containing updated version of UglifyJS?

from uglifier.

bbuchalter avatar bbuchalter commented on May 25, 2024

I will try these things tomorrow and close the ticket on the sprockets side.
Thanks for the quick reply!

On Thu, Jun 2, 2011 at 5:22 PM, lautis <
[email protected]>wrote:

This error is thrown from inside UglifyJS. For some reason, it doesn't like
your JS.

To solve this issue,

  1. Would it be possible to see the JS code (or some narrowed down example)
    causing this?
  2. Could you try the latest master containing updated version of UglifyJS?

Reply to this email directly or view it on GitHub:
#10 (comment)

"Who is the happier man, he who has braved the storm of life and lived, or
he who has stayed securely on shore and merely existed?" - HST
"In the long run, you could die tomorrow." - LS

from uglifier.

tma avatar tma commented on May 25, 2024

Hi there,

If I may jump in. I get the same error and tried it out with uglifier master. Still the same problem :|.

Unexpected character ''
  (in /../app/assets/javascripts/application.js)
/../gems/execjs-1.1.0/lib/execjs/ruby_racer_runtime.rb:27:in `rescue in eval'
/../gems/execjs-1.1.0/lib/execjs/ruby_racer_runtime.rb:18:in `eval'
/../gems/execjs-1.1.0/lib/execjs/ruby_racer_runtime.rb:13:in `exec'
/../bundler/gems/uglifier-8fae4e3f95e9/lib/uglifier.rb:79:in `compile'

from uglifier.

lautis avatar lautis commented on May 25, 2024

@tma, can you post example JS code which causes this error?

The error is happening in UglifyJS parsing. Unfortunately, the exception thrown doesn't give any hints at where it is occurring. It's related to regular expression parsing.

Does the unminified code work without errors in different browsers?

from uglifier.

tma avatar tma commented on May 25, 2024

It's a lot of JS code. The code was tested on all major browsers and version and works fine. I give it a try to isolated the problem to some JS code.

Does UglifyJS have some limitations or some written guide what JS code it accepts?

from uglifier.

lautis avatar lautis commented on May 25, 2024

Not to my knowledge. Part of its original value proposal was that it's supposed to be more conservative about it's assumptions, i.e. with statements and other "bad parts" should work fine.

from uglifier.

tma avatar tma commented on May 25, 2024

Ok. I was able to isolate the parse error to two JS dependencies (jquery libraries) I use in this app: jquery.blockUI and jquery.cleditor.

blockUI: https://github.com/malsup/blockui/blob/master/jquery.blockUI.js
cleditor: https://github.com/cleditor/cleditor/blob/master/jquery.cleditor.js

Do see any obvious problems that could cause the UglifyJS parse error?

from uglifier.

bbuchalter avatar bbuchalter commented on May 25, 2024

I also am using jquery.blockUI.js (but not jquery.cleditor.js) when
I received the error.

On Fri, Jun 3, 2011 at 6:59 AM, tma <
[email protected]>wrote:

Ok. I was able to isolate the parse error to two JS dependencies (jquery
libraries) I use in this app: jquery.blockUI and jquery.cleditor.

blockUI: https://github.com/malsup/blockui/blob/master/jquery.blockUI.js
cleditor:
https://github.com/cleditor/cleditor/blob/master/jquery.cleditor.js

Do see any obvious problems that could cause the UglifyJS parse error?

Reply to this email directly or view it on GitHub:
#10 (comment)

"Who is the happier man, he who has braved the storm of life and lived, or
he who has stayed securely on shore and merely existed?" - HST
"In the long run, you could die tomorrow." - LS

from uglifier.

michaelficarra avatar michaelficarra commented on May 25, 2024

I just uglified both of those libraries successfully using uglifyjs version 1.0.2. That mustn't be where the problem is. Are you both using the most recent uglifyjs version and the most recent versions of those libraries (the linked versions)? If either of you were willing to post your problematic code, we could have had this solved hours ago...

from uglifier.

tma avatar tma commented on May 25, 2024

I'm using uglifier master and both linked JS library versions.. and it fails :(. Could it has something to do with the precompiling process.. i.e. does uglifier get a all the javascript concatenated in one thing?

from uglifier.

tma avatar tma commented on May 25, 2024

I posted the problematic code. If I don't require blockUI and cleditor in the application.js of the rails app, the asset precompilation works just fine.

from uglifier.

lautis avatar lautis commented on May 25, 2024

Both files contain unicode Byte Order Mark. This isn't an issue until files are concatenated together in Sprockets. After concatenation, file may contain multiple BOMs and thus becomes invalid Unicode.

I'll fix this in Sprockets and send a pull request to them.

from uglifier.

josh avatar josh commented on May 25, 2024

sstephenson/sprockets@225e079

should be fixed

from uglifier.

tma avatar tma commented on May 25, 2024

Is fixed, works now as expected. Thanks a lot!

from uglifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.