Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected identifier #59

Closed
prateekjahead opened this issue Nov 5, 2018 · 3 comments
Closed

SyntaxError: Unexpected identifier #59

prateekjahead opened this issue Nov 5, 2018 · 3 comments

Comments

@prateekjahead
Copy link

Running into this error when starting my express server:

node_modules/spdy-transport/lib/spdy-transport/priority.js:81
PriorityNode.prototype.removeChildren = function removeChildren () {
^^^^^^^^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)

Not able to resolve it.

@JohannesLoeffler
Copy link

This Error is caused by an mistakenly commented out line in:
node_modules/spdy-transport/lib/spdy-transport/priority.js

Line 71:
PriorityNode.prototype.removeChild = function removeChild (child) {
this.children.weight -= child.weight
var index = utils.binarySearch(this.children.list, child, compareChildren)
/*
if (index !== -1 && this.children.list.length >= index) {
*/
this.children.list.splice(index, 1)
}
}

@Mydayyy
Copy link

Mydayyy commented Nov 6, 2018

You all probably followed this "fix" and forgot about it. Congratulations!: #47 (comment)

First of all, the linked comment is extremly bad practice. Like unbelievable bad. Further, you probably should remember when you implement said bad practice in your projects, or, ideally, never do that.

I just had to deal with a project which also implemented said "fix" and its horrible.

@prateekjahead
Copy link
Author

As critically explained by @Mydayyy, removing the quickFix mentioned in this comment did the job! Thanks all! 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants