Questions tagged [unexpected-token]
213 questions
0
votes
0 answers
I'm getting "Uncaught SyntaxError: Unexpected token <" but I can't find the issue
I am receiving this error:
Uncaught SyntaxError: Unexpected token <
which in turn is causing this error:
Uncaught ReferenceError: nfForms is not defined
at n.initialize (front-end.js:1)
at n.s.Object (front-end-deps.js:20)
at new n…

JSum
- 597
- 9
- 20
0
votes
1 answer
Site does not work on a ipad 8.4.1 but works on newer ipads, or Android or pc
I get this error:
SyntaxError: Unexpected token '>'
at this line:
const isUsingDevice = (devices,value) => devices.some(d => value.includes(d));
How can I make the site not crash at this line, on older iOS devices?

rosu alin
- 5,674
- 11
- 69
- 150
0
votes
2 answers
React Native Networking Unexpected Token in Function
I am currently trying to learn React Native, but I already struggle in the Networking Part of the Tutorial.
This is the code:
import React, { Component } from 'react';
import { AppRegistry, Text, TextInput, View } from 'react-native';
class App…
user3993570
0
votes
1 answer
Angular 2 Uncaught SyntaxError: Unexpected Token <
I've seen that this problem is fairly common across Angular 2, but I haven't seen anything that helps with my particular situation.
Specifically, I'm creating an app that's pulling data from an API (which requires an API key), where the results are…

durham989
- 31
- 5
-1
votes
1 answer
Unexpected token, expected "..."
I got the error: Unexpected token, expected "..."
I use react unstated.
My code:
return (
{chatProvider => (
<>
Hello World
>
)
}
…

Jak2k
- 57
- 1
- 7
-1
votes
1 answer
SyntaxError:Unexpected token, expected ","
Error it self
How it looks in VScode
Thats Toollsit component
import React, { Component } from 'react';
import Toolitem from './Toolitem'
import App from '../App';
const styles = {
ul:{
listStyle:"none",
width:"300px"
}
}
…

Michael Hamar
- 41
- 9
-1
votes
2 answers
the actual mysql package appears to have a syntax error when used with node.js
So i'm trying to use mysql with nodejs, and when I attempt to use it, I receive a syntax error that appears to originate within the MySQL package itself.
require('/usr/local/bin/mysql')
which returns the…

JamesDockett
- 47
- 6
-1
votes
1 answer
How to fix this "Syntax error:Unexpected identifier"?
I am trying to make an js contact app program that has to save a Contact number and phone and I get this error "Unexpected identifier at line 61".
I don't know where seems to be the ending point, how can I solve this? Here is my code:
class Contact…

Claudiu Piturca
- 1
- 1
- 4
-1
votes
1 answer
Unexpected token 'this' (javascript)
I'm new to coding, and this is my first post. Any help you can offer is greatly appreciated. I'm trying to create a level calculation system that you might see in an RPG for a character with different stats. When I run the program at different…

Sean Kennedy
- 19
- 4
-1
votes
1 answer
Node.js "unexpected token error" (needs help_
Alright, so I was coding my discord bot (not going to put full code) and I got an unexpected token error. This had happened to me before, but I've tried to check for 2 hours straight and nothing really happened. Here's my code down below.
Node.js…

Smoothie
- 1
- 1
-1
votes
1 answer
I get an unexpected token error for lines 2,3,4 and 7
enter code here
fn = function(a, b, c) {
if ((b^2 - 4ac) > 0) {
root1 = ((-b) + sqrt((b^2) - 4 a c)) / (2 * a)
root2 = ((-b) - sqrt((b^2) - 4 a c)) / (2 * a)
print(root1)
print(root2)
} else if (b*2 -4a*c == 0) {
root = -b / (2*a)
print(root)
}…

KevoK
- 1
- 2
-1
votes
1 answer
1-initialaizing array and 2-initialaizing instance variables(java)
My question is that I can not quantify the elements of an array in the body of the class and I get an error:(Unexpected token) and I can only define it but not initialize it.
int[] a=new int[9];
a[7]=8;//error

amz
- 32
- 6
-1
votes
1 answer
Google App script SyntaxError: Unexpected token '<' when running script
Anyone aware of what the problem is here?
It has worked multiple times, even with
const htmlForEmail = htmlTemplate.evaluate().getContent();
and now it seems to throw back an error:
The error: Error
SyntaxError: Unexpected token '<'
electrical @…

GudCoder
- 1
- 2
-1
votes
1 answer
Is this right to write document.write(x=4 + ++x);
it shows error when i run it like this.
but if i first use document.write(x=4,++x); //45
and then write again document.write(x=4 + ++x ) it surprisingly runs and shows me output //4510
can anyone tell me why
-1
votes
1 answer
SyntaxError Unexpected token if within a function
I'm currently learning javascript (by using Google Script currently), I feel like this is a simple mistake, but I can't figure out a way around it.
The code below works, if I set "var colour" to a colour code. But when I change it to an if statement…

Hayden
- 3
- 3