Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Difficulty initializing from Travis CI #34

Closed
jwentz-boc opened this issue Mar 22, 2016 · 5 comments
Closed

Difficulty initializing from Travis CI #34

jwentz-boc opened this issue Mar 22, 2016 · 5 comments

Comments

@jwentz-boc
Copy link

rquery works fine in my local dev environment, karma and webpack (and is very helpful, thx!).
However when I try to run the tests under Travis (continuous integration service) I see the following error.

22 03 2016 14:00:48.500:DEBUG [web-server]: serving (cached): /home/travis/build/betteroutcomes/boc-pro/tests.webpack.js
  Uncaught TypeError: Cannot read property 'TestUtils' of undefined
  at /home/travis/build/betteroutcomes/boc-pro/tests.webpack.js:37072

It seems, looking at the source, that this line is failing:

https://github.com/percyhanna/rquery/blob/master/rquery.js#L13

I added some logs to the test, to try to understand the initialization better:

var React= require('react');
var ReactDOM = require('react-dom');
var TestUtils = require('react-addons-test-utils');
var _ = require('lodash');
console.log(typeof require);
console.log(typeof exports);
console.log(typeof module);
var $R = require('rquery')(_, React, ReactDOM, TestUtils);

but the result doesn't help explain what is going on:

Chromium 45.0.2454 (Ubuntu 0.0.0) LOG: 'function' 
Chromium 45.0.2454 (Ubuntu 0.0.0) LOG: 'object'
Chromium 45.0.2454 (Ubuntu 0.0.0) LOG: 'object'
Chromium 45.0.2454 (Ubuntu 0.0.0) ERROR
  Uncaught TypeError: Cannot read property 'TestUtils' of undefined    
    at /home/travis/build/betteroutcomes/boc-pro/tests.webpack.js:37072 

Any suggestions as to what might be the problem? (Thanks in advance)

@percyhanna
Copy link
Owner

My best guess is that Travis is installing a different version of React than you are using locally. Perhaps it's installing a v0.15 RC? Using shrink wrap might solve this problem. I haven't worked on adding v0.15 support yet.

@jwentz-boc
Copy link
Author

thx for the speedy reply…..I don’t think 0.15 is the problem, I’m actually running npm install to setup the node env for travis:

  • npm install --save-dev react react-dom react-addons-test-utils
  • npm install --save-dev karma karma-cli karma-mocha karma-webpack karma-chrome-launcher
  • npm install --save-dev babel-core babel-loader babel-preset-react
  • npm install --save-dev expect rquery lodash

npm list shows..

├── react-dom@0.14.7

’Tis a bit confusing…

On Mar 22, 2016, at 10:49 AM, Andrew Hanna notifications@github.com wrote:

My best guess is that Travis is installing a different version of React than you are using locally. Perhaps it's installing a v0.15 RC? Using shrink wrap might solve this problem. I haven't worked on adding v0.15 support yet.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #34 (comment)

@percyhanna
Copy link
Owner

I'm wondering if this was caused by the issue described in #35? Can you try again and see if it's working now?

@jwentz-boc
Copy link
Author

Indeed, I can confirm that fixed the problem.

Thanks, both for rquery itself and for the fix!

cheers /j

@percyhanna
Copy link
Owner

🍻

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

No branches or pull requests

2 participants