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

Problem using with webpack #56

Open
mleduque opened this issue May 17, 2016 · 0 comments
Open

Problem using with webpack #56

mleduque opened this issue May 17, 2016 · 0 comments

Comments

@mleduque
Copy link

I'm trying to use imagediff with webpack (actually, karma-webpack).
During "compilation", I get

ERROR in ./~/imagediff/imagediff.js
Module not found: Error: Cannot resolve module 'fs' in [...]/node_modules/imagediff
 @ ./~/imagediff/imagediff.js 336:4-17

Then the tests are launched and I see

  Uncaught TypeError: Cannot read property 'imagediff' of undefined
  at [...]/karma/tests/visualfill.js:69949 <- webpack:///~/imagediff/imagediff.js:37:4

Looking a bit at the source (not that I understand much), I see things like

  if (typeof module !== 'undefined') {
    imagediff.imageDataToPNG = imageDataToPNG;
  }

even though I think webpack defines module.

Also

(function (name, definition) {
  var root = this;

I think this is undefined there (in strict mode).

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

No branches or pull requests

1 participant