Created
July 18, 2015 22:06
-
-
Save stochastic-thread/01da77860387fa73db59 to your computer and use it in GitHub Desktop.
UNEXPECTED TOKEN (20:6)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Socket} from "phoenix" | |
class App { | |
static init(){ | |
let socket = new Socket("/ws", { | |
logger: (kind, msg, data) => { console.log(`${kind}: ${msg}`, data) } | |
}) | |
socket.connect() | |
var current_user_id = parseInt($('user').attr('data-id')) | |
var chan = socket.chan("notifs:"+current_user_id, {}) | |
var oldval = $('#notifs').val() | |
chan.join() | |
.receive("ignore", e => console.log("received ignore on channel (auth error)")) | |
.receive("ok", e => console.log("received ok on channel (join ok)")) | |
chan.on("new_msg", payload => | |
console.log("Channel received new_msg, here is payload: \n" + payload.body) | |
if (oldval == "") { | |
oldval = 0 | |
} | |
else { | |
oldval = oldval + 1 | |
} | |
$('#notifs').append(oldval) | |
) | |
var $button = $("#wsbutton") | |
$button.on("click", function() { | |
console.log("test click") | |
chan.push("new_msg", {body: "HELLLLOOOO BUTTON"}) | |
}) | |
} | |
} | |
$( () => App.init() ) | |
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 Jul 18:01:13 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:01:42 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:01:47 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:01:53 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:02:09 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:02:18 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:02:32 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:02:58 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:03:08 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:03:24 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:03:24 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:03:32 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:03:38 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:03:44 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:03:50 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (19:6) | |
18 Jul 18:04:00 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (21:6) | |
18 Jul 18:04:02 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:04:14 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:04:34 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:04:42 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:05:58 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:06:00 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) | |
18 Jul 18:06:14 - error: Compiling of 'web/static/js/app.js' failed. web/static/js/app.js: Unexpected token (20:6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment