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

undefined:1 #16

Closed
chraibi opened this issue Dec 20, 2016 · 11 comments
Closed

undefined:1 #16

chraibi opened this issue Dec 20, 2016 · 11 comments

Comments

@chraibi
Copy link

chraibi commented Dec 20, 2016

I get the following errors

undefined:1
[object Object]
 ^

SyntaxError: Unexpected token o
    at Object.parse (native)
    at /Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/lib/ApiBaseHTTP.js:88:42
    at _Class.wrap_response (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/lib/API.js:192:18)
    at _Class.wrap_response (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/lib/API.js:4:59)
    at Request._callback (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/lib/API.js:215:26)
    at Request.self.callback (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/node_modules/request/request.js:186:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/node_modules/request/request.js:1081:10)
    at emitOne (events.js:77:13)

This is my settings-file

{
  "gitlab": {
    "url": "http://gitlab.version.fz-juelich.de/",
    "token": "{{TOKEN}}",
    "projectID": null
  },
  "github": {
    "url": "api.github.com",
    "pathPrefix": "JuPedSim",
    "owner": "{{JuPedSim}}",
    "username": "{{chraibi}}",
    "password": "{{pw}}",
    "repo": "{{jpscore}}"
  },
  "usermap": {
    "chraibi1": "chraibi",
      "graf2": "ArneGraf",
      "andresen1": "Erik-Andresen"
  },
  "projectmap": {
    "JuPedSim/jpscore": "JuPedSim/jpscore"
  }
}

I validated the file. Any idea what went wrong?

@spruce
Copy link
Member

spruce commented Dec 20, 2016

Have you looked into issue #11 ? Sounds like the same thing

@chraibi
Copy link
Author

chraibi commented Dec 21, 2016

Yes it looks very similar, however there is no solution there.
I was also thinking something must be wrong with the setting file. I checked it
with this validator. It does not give any error.

I looked at the white spaces but does not see anything suspicious.

I also use this code to parse the file

var fs = require("fs");                                                                                                                                                                                                                                    
  fs.readFile("settings.json", function(err, json) {                                                                                                                                                                                                         
    // turn the valid json text back into an object.                                                                                                                                                                                                         
    var object = JSON.parse(json);                                                                                                                                                                                                                           
    console.log(object);                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                             
    console.log(typeof json);                                                                                                                                                                                                                                
    console.log(typeof object);                                                                                                                                                                                                                              
  }); 

@spruce
Copy link
Member

spruce commented Jan 25, 2017

I just noticed. That your stacktrace actually points to one of the dependencies: gitlab.

@spruce
Copy link
Member

spruce commented Jan 25, 2017

See: jdalrymple/gitbeaker#149

@solteroluis35
Copy link

Is there a workaround I could use for this in the mean time the pull request is merged?

@solteroluis35
Copy link

What @MJochim proposed on jdalrymple/gitbeaker#149 worked for me as a workaround.

@spruce
Copy link
Member

spruce commented Sep 23, 2017

I got the PR merged but sadly there is still no new release on npm.

@spruce
Copy link
Member

spruce commented Oct 23, 2017

Still no new version

@spruce
Copy link
Member

spruce commented Mar 24, 2018

With 5f506a2 I upgraded to a maintained version of the gitlab module. Can you check if it works?

@spruce
Copy link
Member

spruce commented Apr 7, 2018

I'm closing this because there is no reaction. Please feel free to reopen if it still doesn't work.

@spruce spruce closed this as completed Apr 7, 2018
@chraibi
Copy link
Author

chraibi commented Jun 12, 2019

Thanks for your efforts and sorry for missing this.
I don't have this error anymore but hit another one :-)

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

No branches or pull requests

3 participants