badsyntax / react-seed

[not maintained] Seed project for React apps using ES6 & webpack.
http://badsyntax.github.io/react-seed
MIT License
428 stars 82 forks source link

Can't import Sinon #21

Open eguneys opened 9 years ago

eguneys commented 9 years ago

When I add this line to my tests:

import Sinon from 'sinon';

I get a bunch of warnings and finally an error:

// ...
WARNING in ./~/sinon/lib/sinon/util/event.js
Critical dependencies:
107:25-32 require function is used in a way in which dependencies cannot be statically extracted
 @ ./~/sinon/lib/sinon/util/event.js 107:25-32

WARNING in ./~/sinon/lib/sinon/util/fake_xdomain_request.js
Critical dependencies:
219:25-32 require function is used in a way in which dependencies cannot be statically extracted
 @ ./~/sinon/lib/sinon/util/fake_xdomain_request.js 219:25-32

WARNING in ./~/sinon/lib/sinon/util/core.js
Critical dependencies:
382:25-32 require function is used in a way in which dependencies cannot be statically extracted
 @ ./~/sinon/lib/sinon/util/core.js 382:25-32

WARNING in ./~/sinon/lib/sinon/util/fake_xml_http_request.js
Critical dependencies:
627:25-32 require function is used in a way in which dependencies cannot be statically extracted
 @ ./~/sinon/lib/sinon/util/fake_xml_http_request.js 627:25-32

WARNING in ./~/sinon/lib/sinon/util/fake_timers.js
Critical dependencies:
73:25-32 require function is used in a way in which dependencies cannot be statically extracted
 @ ./~/sinon/lib/sinon/util/fake_timers.js 73:25-32
PhantomJS 1.9.8 (Linux 0.0.0) ERROR
  TypeError: 'undefined' is not an object (evaluating 'modules[moduleId].call')
  at /home/ubuntu/webdev/learn/yuzbir-react/app/app.tests.js:20:0 <- webpack:/webpack/bootstrap 6f2205015bef446b3e59:19:0
ikornienko commented 9 years ago

I have the same problem when I try to import sinon in my project. Seems like sinon's bug. @eguneys have you found any solution?