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

Error using tern with threejs library #1026

Open
kjuen opened this issue Jul 14, 2019 · 0 comments
Open

Error using tern with threejs library #1026

kjuen opened this issue Jul 14, 2019 · 0 comments

Comments

@kjuen
Copy link

kjuen commented Jul 14, 2019

Trying to use tern with the threejs library, https://threejs.org, resulted in the following error:

Request failed: Could not start Tern server
def.js:439
throw new Error("Invalid !type spec: " + tp);
^

Error: Invalid !type spec: number
at passOne (def.js:439:17)
at doLoadEnvironment (def.js:515:74)
at Object.exports.load (def.js:535:7)
at infer.js:869:13
at Object.exports.withContext (infer.js:883:18)
at new exports.Context (infer.js:851:13)
at exports.Server.reset (tern.js:153:17)
at new exports.Server (tern.js:130:10)
at startServer (bootstrap.js:139:16)
at bootstrapServer (bootstrap.js:162:10)

(Note that I removed absolute paths from the error message and traceback)
The tern version is 0.24.1.. I created the threejs.json file with the following command:
./condense --name threejs /opt/js/three.js/build/three.min.js > ../defs/threejs.json

With a bit of trial and error I got tern to work by removing some lines of the threejs.json file. But it seems that something is wrong either with generating or parsing the json definition file.

These are the lines I removed from threejs.json to make the whole thing work:

  • "THREE.PropertyMixer.prototype.accumulate.!0": {
  •  "!type": "number",
    
  •  "!span": "494860[838:378]-494861[838:379]"
    
  • },
  • "THREE.PropertyMixer.prototype._select.!1": {
  •  "!type": "number",
    
  •  "!span": "495506[840:4]-495507[840:5]"
    
  • },
  • "THREE.PropertyMixer.prototype._lerp.!1": {
  •  "!type": "number",
    
  •  "!span": "495647[840:145]-495648[840:146]"
    
  • },

and

  • "THREE.PropertyMixer._mixBufferRegion.!1": {
  •  "!type": "number",
    
  •  "!span": "495647[840:145]-495648[840:146]"
    
  • },
  • "THREE.AnimationMixer._actions.": {
  •  "_byClipCacheIndex": {
    
  •    "!type": "number",
    
  •    "!span": "511077[869:472]-511094[869:489]"
    
  •  },
    
  •  "_cacheIndex": {
    
  •    "!type": "number",
    
  •    "!span": "511166[870:57]-511177[870:68]"
    
  •  }
    
  • },

Tern is great. Thanks for providing it!

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

No branches or pull requests

1 participant