Closed maikdiepenbroek closed 8 years ago
I've been able to find a workaround for this by using the following
npm install --save-dev phantomjs-polyfill
require('phantomjs-polyfill')
var React = require('react');
Props to https://github.com/conversocial/phantomjs-polyfill for the npm installable polyfill.
This issue was fixed in PhantomJS 2, though? https://github.com/ariya/phantomjs/issues/10522
Anyway, good to see that you've found a solution.
After setting up a test suite and trying to test with PhantomJS, i get the following error:
Looking into this file i see the following code:
Which is the contents of this file: https://github.com/martyjs/marty/blob/master/marty.js
It looks to me as if this has something to do with the window object missing, since using 'Chrome' as a browser works fine.
Edit: Looking at the code again it looks like the bottom part causes the error, which seems weird since react is resolved as a dependency through webpack.