Comments (14)
This error is thrown from inside UglifyJS. For some reason, it doesn't like your JS.
To solve this issue,
- Would it be possible to see the JS code (or some narrowed down example) causing this?
- Could you try the latest master containing updated version of UglifyJS?
from uglifier.
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,
- Would it be possible to see the JS code (or some narrowed down example)
causing this?- 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.
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.
@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.
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.
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.
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.
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.jsDo 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.
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.
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.
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.
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.
should be fixed
from uglifier.
Is fixed, works now as expected. Thanks a lot!
from uglifier.
Related Issues (20)
- Example for harmony in readme is very dangerous HOT 4
- inlining dependencies HOT 2
- Jekyll configuration to use ES6
- Different versions between `VERSION` and published HOT 2
- Uglifier::Error: Unexpected token: name (package)
- Uglifier::Error: HOT 6
- Uglifier Cannot Precompile JS Optional Chaining HOT 3
- Uglifier runs into problems with certain combination of modern JS syntax (await, destructuring, Promise.all) HOT 1
- Uglifier complains about field declaration syntax HOT 1
- NoMethodError: undefined method `start_with?' for nil:NilClass HOT 1
- jekyll 3.8.7 | Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).
- Changing Uglifier.new parameters does nothing if I dont clean manually the assets files first HOT 2
- Documentation for :define => {} ?
- Custom replacements
- Uglifier::Error: - Solution: Switch to terser HOT 15
- Uglifier::Error: Unexpected token: punc (.) HOT 4
- Uglifier error in production mode on RoR 7.0.3.1 with Bootstrap 5.2 HOT 16
- Uglifier assets compiling error HOT 1
- XHTML style script tag within comment breaks parsing
- Update UglifyJS to 3.17.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uglifier.