0

I run an old application that was built in 2015. Now I'm using Node.js and running the server, everything is good apart from angularjs. Can Anybody tell me what the error is? As I didn't find any help on the internet.

The error is shown in Google Chrome.

SyntaxError: Illegal continue statement
at Object.instantiate (http://localhost:3000/lib/js/angular.min.js:42:56)
at http://localhost:3000/lib/js/angular.min.js:90:32
at Object.link (http://localhost:3000/lib/js/angular-route.min.js:7:274)
at http://localhost:3000/lib/js/angular.min.js:16:71
at la (http://localhost:3000/lib/js/angular.min.js:81:90)
at p (http://localhost:3000/lib/js/angular.min.js:66:341)
at g (http://localhost:3000/lib/js/angular.min.js:58:481)
at http://localhost:3000/lib/js/angular.min.js:58:119
at http://localhost:3000/lib/js/angular.min.js:63:39
at d (http://localhost:3000/lib/js/angular.min.js:59:474) <div ng-view="" class="ng-scope" data-ng-animate="1">

And Call stack is when I paused on exception in Google Chrome.

"Error: Failed to execute 'matches' on 'Element': ':visible' is not a valid selector.

↵ at Function.gb.matchesSelector (http://localhost:3000/lib/js/jquery-1.11.2.min.js:2:12236)↵ at Function.m.filter (http://localhost:3000/lib/js/jquery-1.11.2.min.js:2:23357)↵ at w (http://localhost:3000/lib/js/jquery-1.11.2.min.js:2:23168)↵ at m.fn.init.is (http://localhost:3000/lib/js/jquery-1.11.2.min.js:2:23894)↵ at e.(anonymous function).(anonymous function). (http://localhost:3000/lib/js/jquery-ui.min.js:9:18176)↵ at i (http://localhost:3000/lib/js/jquery-ui.min.js:6:12380)"

Package.JSON

    {
  "name": "hcphes_web_app",
  "version": "2.2.1",
  "description": "HCPHES Web App",
  "main": "server.js",
  "dependencies": {
    "applicationinsights": "~0.15.2",
    "async": "~0.9.0",
    "azure-storage": "~0.4.5",
    "body-parser": "~1.12.2",
    "chart.js": "^2.3.0",
    "express": "~4.12.3",
    "mongodb": "2.2.27",
    "nodemailer": "~0.7.1",
    "sendgrid": "~1.6.1"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
mujuonly
  • 11,370
  • 5
  • 45
  • 75
ephemeral
  • 429
  • 2
  • 7
  • 16
  • 2
    looks like you have "continue" statement in some inapropriate place, try find it inside the application code and place here – happyZZR1400 Jun 08 '17 at 12:56
  • Also provide what version of Angular you're using. – tiblu Jun 08 '17 at 12:56
  • @tiblu how can I get version of angular ? – ephemeral Jun 08 '17 at 12:58
  • @happyZZR1400 I dont think so. this application was live for 2 years. Code is fine. but maybe conflict in versions ? how can I know angular version ? – ephemeral Jun 08 '17 at 12:59
  • @ephemeral normally it's declared at the top of the file, although it might not be as it's minified, have a look at the answers [to this question to find out the version](https://stackoverflow.com/questions/16017699/how-can-i-check-which-version-of-angular-im-using) – George Jun 08 '17 at 13:00
  • 1
    run "angular.version" inside console panel – happyZZR1400 Jun 08 '17 at 13:01
  • @happyZZR1400 its angular.version = full ='1.5.8' chrome console return that – ephemeral Jun 08 '17 at 13:03
  • @tiblu its 1.5.8 – ephemeral Jun 08 '17 at 13:04
  • Using Chrome, open `dev tools`, then go to `Source Panel`, then activate `pause on exception`, then `refresh your browser` and when it pauses due to the exception, look at the `Call Stack Tab` and search where the error happens. – Hitmands Jun 08 '17 at 13:04
  • @Hitmands I included result in question. can you tell what is error ? – ephemeral Jun 08 '17 at 13:10
  • do you have package.json file in yur project? – happyZZR1400 Jun 08 '17 at 13:10
  • @happyZZR1400 yes I have let me edit question – ephemeral Jun 08 '17 at 13:11
  • `"Error: Failed to execute 'matches' on 'Element': ':visible' is not a valid selector.` seems to be related to another error, you may have more errors... the error `SyntaxError: Illegal continue statement` indicates that you're using the `continue` statement wrongly, so, try to search all over the code and check where you are using `continue` (it is usually used inside loops). Finally, if the app has more than two years, I think you should downgrade the angularjs version to `1.3*` – Hitmands Jun 08 '17 at 13:14
  • looks like you trying to get some html element using ':visible' selector (Which is jquery selector) , btw may be to add jquery to project is good idea – happyZZR1400 Jun 08 '17 at 13:19
  • this is very strange you have no angular node inside you package.json, may be angular is on bower.json? – happyZZR1400 Jun 08 '17 at 13:29
  • @happyZZR1400 yes I got solved . Can you post as answer please ? and what should I replace return true ? – ephemeral Jun 09 '17 at 05:05
  • @Hitmands thank you brother . I got solved yes it was continue issue. but It is weird instead of jquery why angular lib was error destination . Now I should replace return true instead ? – ephemeral Jun 09 '17 at 05:06
  • I think it will be very helpfull if you place the fragment of code where the "continue" statement which causing error , so it will be easy to find better replacement... – happyZZR1400 Jun 09 '17 at 15:56

0 Answers0