socket.io in client page SyntaxError: Unexpected token <

820 views
Skip to first unread message

Ahmed Mostafa

unread,
Jan 28, 2014, 7:29:31 AM1/28/14
to zomb...@googlegroups.com
I am running tests using mocha using Zombie as a headless web browser ... doing a great job thank you

problem is , my page has an include for socket.io client 

<script type="text/javascript" src="/socket.io/socket.io.min.js"></script>

when my test is redirected to this page .. it fails with this error 
SyntaxError: Unexpected token <

i checked it multiple times ! 
i used socket.io.min.js and i used socket.io.js both introduce the same error and it's making me angry !

what is the problem ? and how can i solve it ?

Ahmed Mostafa

unread,
Jan 28, 2014, 7:36:31 AM1/28/14
to zomb...@googlegroups.com
    at Contextify.sandbox.run (node_modules/zombie/node_modules/jsdom/node_modules/contextify/lib/contextify.js:12:24)
    at Object.window._evaluate (node_modules/zombie/lib/zombie/window.js:187:25)
    at Object.HTML.languageProcessors.javascript (node_modules/zombie/lib/zombie/scripts.js:23:21)
    at Object.define.proto._eval (node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:1475:47)
    at Object.loaded (node_modules/zombie/lib/zombie/scripts.js:74:23)
    at node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:73:20
    at Object.item.check (node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:345:11)
    at node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:363:12
    at node_modules/zombie/lib/zombie/eventloop.js:238:18
    at Object._onImmediate (node_modules/zombie/lib/zombie/eventloop.js:143:11)

so here is a full dump of the error

Assaf Arkin

unread,
Jan 29, 2014, 12:57:19 PM1/29/14
to Ahmed Mostafa, zomb...@googlegroups.com
“Unexpected token <“ happens when the server sends back an HTML document (often 404 or 500 error page) instead of JavaScript.

--
You received this message because you are subscribed to the Google Groups "zombie.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zombie-js+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

–––––

Subscribe to Weekend Reading, a newsletter about design, code, startup life and the occasional odd

Reply all
Reply to author
Forward
0 new messages