question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Danger crashes on travis ci with error from gitlab

See original GitHub issue

We recently updated to danger v9.0.1 and it was working just fine. However we recently noticed the following error showing up on travis when we run danger.

Log:
Creating network "terracore_default" with the default driver
Creating terracore_standalone-chrome_1 ... 
Creating terracore_standalone-chrome_1
> terra-core@0.1.0 danger /opt/module
> danger ci
/opt/module/node_modules/gitlab/dist/index.js:1
(function (exports, require, module, __filename, __dirname) { "use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var universalUrl=require("universal-url"),Li=_interopDefault(require("li")),humps=require("humps"),Ky=_interopDefault(require("ky-universal")),FormData=_interopDefault(require("form-data")),queryString=require("query-string"),randomstring=_interopDefault(require("randomstring")),extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function __extends(e,t){function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=argument
TypeError: global$1.XMLHttpRequest is not a constructor
    at checkTypeSupport (/opt/module/node_modules/gitlab/dist/index.js:1:32017)
    at Object.<anonymous> (/opt/module/node_modules/gitlab/dist/index.js:1:32341)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/module/node_modules/danger/distribution/platforms/gitlab/GitLabAPI.js:39:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! terra-core@0.1.0 danger: `danger ci`
npm ERR! Exit status 1
npm ERR! 

It looks like there may be an issue in the gitlab package as this line alludes to:

TypeError: global$1.XMLHttpRequest is not a constructor
    at checkTypeSupport (/opt/module/node_modules/gitlab/dist/index.js:1:32017)

It looks like a new 6.x minor version of gitlab was just released a few hours ago that may be triggering this breaking change.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ashfurrowcommented, Jul 1, 2019

Seeing the fix from #885 work as expected: https://github.com/artsy/eigen/pull/2854 Thanks @orta and @f-meloni!

1reaction
ashfurrowcommented, Jul 1, 2019

I’m seeing this too, also on Danger-Swift (example failure). I think this is happening since a new version of node-gitlab was introduced with the bug that @tyankatsu0105 linked to, and since we installed Danger-Swift with npm install -g danger, we get the latest version of its dependencies (no lock file, so no pinning).

I think the “right” solution is just to wait for the GitLab bug to get fixed, then things should “just work” for Danger-Swift. If you need a workaround in the meantime, you can explore either adding a Yarn/NPM lockfile to pin to an older version of node-gitlab, or using NPM to install a specific version of node-gitlab before installing Danger (so that the older version is used as a dependency).

npm install -g gitlab@6.3.7
npm install -g danger

Which should work, though I haven’t yet tried it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Build Problems - Travis CI Docs
If your build is failing due to unexpected segmentation faults in the language interpreter, this may be caused by corrupt or invalid caches...
Read more >
Please read this before posting a new topic - Windows
Trying to launch a Windows job in debug mode returns this error: /c/Users/travis/.travis/job_stages: line 694: travis_debug: command not ...
Read more >
Testing With Browser (#1335) · Issues · GitLab.org / gitlab-runner
So our goal to start with is to get the BP I linked to, to run on GL with Chrome as the browser...
Read more >
CHANGELOG - Danger.systems
Adds GitLab & GitLab CI support - @notjosh, @bigkraig, @jamime ... link to apollo-client dangerfile.ts example [@andykenward]; Fix crash that may occur when ......
Read more >
Travis CI vs Gitlab CI comparison of Continuous Integration ...
What are the differences for Travis CI or Gitlab CI? ... Risk-free integration! ... save time & money; deliver features faster; catch errors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found