Does anyone have any idea how to resolve this error?
The google devt tools does not pinpoint the location of the erroneous code which makes it hard to troubleshoot.
Im currently on Meteor and MongoDB. Ive searched for Unexpected tokens, theres A, N, C but M is not mon.
What Ive read is it might be a server menting problem as it adds random letters and non-recognizable scripts.
Any suggestions?
Does anyone have any idea how to resolve this error?
The google devt tools does not pinpoint the location of the erroneous code which makes it hard to troubleshoot.
Im currently on Meteor and MongoDB. Ive searched for Unexpected tokens, theres A, N, C but M is not mon.
What Ive read is it might be a server menting problem as it adds random letters and non-recognizable scripts.
Any suggestions?
Share Improve this question asked Apr 5, 2015 at 16:34 ThinkererThinkerer 1,6266 gold badges23 silver badges43 bronze badges 3-
You have an
M
where there's not supposed to be anM
. This error isn't about the character really, it can be any character, it's just that the character is places somewhere it's not supposed to be. – adeneo Commented Apr 5, 2015 at 16:37 -
1
It's impossible to say where the error es from without seeing the code, but the "Unexpected token ..." error often happens because of an illegal token in a string provided to the
JSON.parse()
method. – Marco Bonelli Commented Apr 5, 2015 at 16:46 - @Marco Bonelli - You are right, it's JSON.parse that's plaining – mwarren Commented Apr 5, 2015 at 17:46
2 Answers
Reset to default 4ng-inspector maintainer here (I don't have enough rep to add a ment)
I'm sorry that the extension caused issues for you. For what it's worth, we've since updated it (v0.5.8) to handle exceptions from the postMessage data.
I've got the exact same problem, and it's happening at line 1472 in ng-inspector.js at JSON.parse(eventData);
The reason is presumably that event.data is holding some kind of setImmediate string (which begins with the letter 'M') - "Meteor._setImmediate.0.5014774943701923.5"
Here are the five lines in ng-inspector.js leading up to the JSON.parse():
window.addEventListener('message', function (event) {
// Ensure the message was sent by this origin
if (event.origin !== window.location.origin) return;
var eventData = event.data;
if (!eventData || typeof eventData !== 'string') return;
eventData = JSON.parse(eventData);
the debugger shows this stuff in the event object:
event = MessageEvent {data: "Meteor._setImmediate.0.5014774943701923.5", origin: "http://localhost:3000", lastEventId: "", source: Window, ports:
ng-inspector.js is an angular extension for Chrome so I guess all we have to do is uninstall it now that we are using Meteor!
Yes, I can confirm that I have uninstalled the Angular inspector from the Chrome extensions and that the problem is solved.