jhnns / rewire-webpack

Dependency injection for webpack bundles
The Unlicense
121 stars 20 forks source link

Uncaught Error: Cannot find module "module" #9

Closed mziwisky closed 9 years ago

mziwisky commented 9 years ago

I get the above error when trying to use rewire-webpack with webpack 1.5.3. Is rewire-webpack known to be working still with webpack 1.5.x? If so, I'll try to come up with a minimal setup for reproducing this.

jhnns commented 9 years ago

Mhmm ... the tests are running on my machine. You could checkout the repository, run npm test and check localhost:8080/webpack-dev-server/bundle

mziwisky commented 9 years ago

thanks for the quick reply. so I just cloned, did npm install (no errors), did npm test and i get

➜  rewire-webpack (master) $ npm test
# ... webpack stuff ...

ERROR in ./test/webpack.test.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../node_modules/rewire/test/testModules/sharedTestCases.js in /Users/mziwisky/repos/rewire-webpack/test
 @ ./test/webpack.test.js 4:0-69

Looks like it pulled in rewire v2.2.0, because of the "rewire": "jhnns/rewire" devDependency, but that version isn't compatible. I made the dependency "rewire": "jhnns/rewire#v2.1.3" instead, and now the tests run and pass. gonna try pulling it into my project with this tweak and see if my woes are allayed.

mziwisky commented 9 years ago

d'oh! i think after all i just had a configuration issue. i wasn't actually including the plugin in my test environment :flushed:. still should fix that dependency issue tho :wink:. i'll be off now.

jhnns commented 9 years ago

No problem! :)