Questions tagged [unexpected-token]

213 questions
0
votes
0 answers

How to parameterise a command invocation inside a script block?

I am trying to write a PowerShell script with a Script Block that is to be passed to Invoke-Command. The script block needs to invoke an executable whose path is determined by a PowerShell variable ($bar in this example) However, when I try to do…
jonseymour
  • 1,006
  • 1
  • 12
  • 22
0
votes
0 answers

What is this 'Unexpected token / in JSON at position 772' i am getting suddenly? (Angular2)

Whenever I want to generate a new component or service, i suddenly get this error message: 'Unexpected token / in JSON at position 772'. I dont know how/what has caused this. There is also no reference to a specific file so I have no clue how to fix…
Y_Lakdime
  • 825
  • 2
  • 15
  • 33
0
votes
2 answers

crop.sh: line 3: syntax error near unexpected token `(' crop.sh: line 3: `foreach file (`ls *.pdf`)'

In what follows, I have written my bash file, crop.sh. However, I get this error when I run it in windows. I used cygwin. I also installed git and used mingw64. I searched a lot but couldn't solve this issue. #!/bin/csh foreach file (`ls *.pdf`) …
0
votes
2 answers

Weebly Uncaught SyntaxError: Unexpected token < in JSON at position 0

I am trying to implement my unity app for my Weebly site. I followed this tutorial: https://www.youtube.com/watch?v=mf-yNlMLcqA I have these two codes: 1.
0
votes
0 answers

Bash script: unexpected end of file

I have the following piece of code: function sindex { x="${1%%$2*}" [[ $x = $1 ]] && echo -1 || echo ${#x} } T_ID_INDEX=$(sindex "$TARGET_RETURN" "id=") T_ID_INDEX=$((T_ID_INDEX + 4)) T_ID=${TARGET_RETURN:T_ID_INDEX:36} And i am…
h.lina
  • 25
  • 7
0
votes
1 answer

unexpected token error .then | promises | nodejs

I've been working on the routing file below. However, it's essentially a photo app where I'll be able to store the data in MondoDB. However, when I run the code below, terminal keeps saying unexpected token .then. Am I missing something here? var…
Annette Lin
  • 51
  • 2
  • 11
0
votes
1 answer

NodeJS Unexpected token "."

I have syntax error(unexpected token ".") in line config.db.database;. This is my code in file const config = require('../config/config') const db = {} const sequelize = new Sequelize({ // SQL constructor config.db.database; config.db.user; …
0
votes
2 answers

Node.js, Express.js - unexpected token {

My app crashes every time it reaches this line: const {name, price} = req.query; ^ can't seem to locate the exact answer..here is the error log SyntaxError: Unexpected token { at exports.runInThisContext (vm.js:53:16) at…
asus
  • 1,427
  • 3
  • 25
  • 59
0
votes
1 answer

Keep Getting : Uncaught SyntaxError: Unexpected token }

The javascript debugger says on line 3 the curly bracket is an unexpected token. Can anyone please help me out with this? setTimeout(rollDice, (multiplier * bconfig.wait) + Math.round(Math.random() * 1000)); }; toggleHiLo = function() { if (hilo…
Retro
  • 21
  • 2
0
votes
1 answer

Odd syntax error in React

So I have custom component with the class App, but still having issues. Am sure it is something easy, but for the likes of me, I am not figuring it out. Basically, my code is: (app.jsx): import React from 'react'; import…
Mark
  • 1,812
  • 3
  • 29
  • 51
0
votes
0 answers

Why is Android Studio giving me problems with my findLongestName method?

I've got an array of names that is declared like this: String[] names = {"Anja", "Kimberli", "Edmond", "Shenna", "Edythe", "Sherrell", "Lindsay", "Randee", "Janell", "Jeremy", "Jaqueline", "Clay", "Nakita", "Elina", "Gwenn", …
0
votes
1 answer

Unexpected tag in AJAX response

I use ElasticSearch in my application, where further search results can be loaded under ajax calls (pagination with ajax). However, the ajax response is coming with a tag in the beginning as it follows: When this response is appended to my HTML…
Siipe
  • 468
  • 1
  • 5
  • 13
0
votes
1 answer

Unexpected token { plus buyHelper and loadCode is not defined?

I was watching a tutorial and followed his code but named the variables and functions myself, but after i did the buyHelper function, my loadCode function stopped working and it kept saying the "{" was unexpected. Please help. (I did all the code in…
0
votes
1 answer

Javascript Syntax Error: Unexpected token -

I know it maybe a simple error but, I have looked at it for hours and, could not find the error. Here is the snippet: