kutyel / linq.ts

🌀LINQ for TypeScript

Home Page:http://kutyel.github.io/linq.ts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Syntax Error: Unexpected token..." happens on some Machines

huserben opened this issue · comments

Hi

First of all, I really like your project as I'm coming from the .NET world and am quite used to the LINQ syntax. So this really simplifies a lot of things for me :-)

I have a question/issue, I'm not really sure if it is related to linqts itself or my way of using it. As I'm not really an expert in the node area this might be, but I hope someone can at least point me in the right direction.

So I'm developing a Build Task that extends TFS/VSTS which is written in typescript and makes use of your extension. Everything was working well since suddenly it stopped working on some machines. The issues started after updating the version from 1.10.0 to 1.10.1. Trying to make it work again I reverted the change back to version 1.10.0 but it still fails for some people. So I tried to update everything to the newest version but it still seems to fail on some machines. What I suspected first is that it might had something to do with the node version installed, however at least on one machine it machtes exactly with what I'm using and it works there...

I'm really out of ideas know and hope someone here has at least an idea on where to start.
The actual error produced is the following (see as well the issue in my github repo):

2018-02-28T21:23:38.4471815Z T:\TFS2015_BuildAgent\tasks\TriggerBuild\2.6.2\node_modules\linqts\dist\linqts.js:1
2018-02-28T21:23:38.4627791Z (function (exports, require, module, __filename, __dirname) { const e=e=>"object"==typeof e,t=(t,r)=>Object.keys(t).every(n=>e(t[n])?(void 0)._equal(r[n],t[n]):r[n]===t[n]),r=e=>(...t)=>!e(...t);class n{constructor(e=[]){this._elements=e}Add(e){this._elements.push(e)}AddRange(e){this._elements.push(...e)}Aggregate(e,t){return this._elements.reduce(e,t)}All(e){return this._elements.every(e)}Any(e){return e?this._elements.some(e):this._elements.length>0}Average(e){return this.Sum(e)/this.Count(e)}Cast(){return new n(this._elements)}Concat(e){return new n(this._elements.concat(e.ToArray()))}Contains(e){return this._elements.some(t=>t===e)}Count(e){return e?this.Where(e).Count():this._elements.length}DefaultIfEmpty(e){return this.Count()?this:new n([e])}Distinct(){return this.Where((r,n,s)=>(e(r)?s.findIndex(e=>t(e,r)):s.indexOf(r))===n)}DistinctBy(e){const t=this.GroupBy(e,e=>e);return Object.keys(t).reduce((e,r)=>(e.Add(t[r][0
2018-02-28T21:23:38.4627791Z SyntaxError: Unexpected token ...
2018-02-28T21:23:38.4627791Z at exports.runInThisContext (vm.js:53:16)
2018-02-28T21:23:38.4627791Z at Module._compile (module.js:387:25)
2018-02-28T21:23:38.4627791Z at Object.Module._extensions..js (module.js:422:10)
2018-02-28T21:23:38.4627791Z at Module.load (module.js:357:32)
2018-02-28T21:23:38.4627791Z at Function.Module._load (module.js:314:12)
2018-02-28T21:23:38.4627791Z at Module.require (module.js:367:17)
2018-02-28T21:23:38.4627791Z at require (internal/module.js:16:19)
2018-02-28T21:23:38.4627791Z at Object. (T:\TFS2015_BuildAgent\tasks\TriggerBuild\2.6.2\node_modules\tfsrestservice\index.js:41:16)
2018-02-28T21:23:38.4627791Z at Module._compile (module.js:413:34)
2018-02-28T21:23:38.4627791Z at Object.Module._extensions..js (module.js:422:10)

I'm thankful about any clue that might help resolve the issue. Thanks for your time already in advance.

Hey you are right sorry I did a quick fix yesterday, can you check with the latest version? (1.10.2) Thanks!

Hi

I will check it tomorrow. I'll let you know once I tried.

Thanks for the quick responnse.

If it does not work you can always lock your dependency to "linqts": "1.10.0" (without the caret) and everything should work as before.

BTW: you can always support the library by giving it a ⭐️ on GitHub :)

Hi

so I saw that apparently version 1.10.2 was already part of the newest package of mine, so I tried it now with the fixed dependency to 1.10.0.

I'll let you know if it worked once I get feedback.

Many thanks for your support.

Hi @kutyel

so it seems that it is resolved now with going back to version 10.0.0.
I'm not sure under what circumstances it failed and why exactly...however I can live with it.

Do you want to do more investigation on this or shall I close the issue?

I'm glad it solved your issue, I will continue to improve the library so feel free to try any coming version 😉