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

If an app and a module use freshy, using freshy from the submodule fails #3

Closed
nerdgore opened this issue Jul 15, 2015 · 3 comments
Closed

Comments

@nerdgore
Copy link

Using freshy in an app causes an error if a submodule is using it too.
In our case, we're using makara (adaro) as a view engine which uses freshy to load dustjs. In our project we use freshy as a dev dependency to reload modules that use stubbed components. Since we have it as a dependency, npm will use the outer dependency.

However in that case freshy will error saying it can not find dustjs-linkedin.

Steps to reproduce:

  1. Init a new npm module

  2. Install and save dependencies

    npm install freshy --save
    npm install makara --save
    
  3. Create an index.js file with the following content:

    var makara = require("makara");
    makara.dust({});
    
  4. Run node index.js -> will cause the following error:

Error: Cannot find module 'dustjs-linkedin'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.require.resolve (module.js:384:19)
    at snapshot (/Users/towalter/workspace/mobile.de/freshy-test/node_modules/freshy/index.js:67:34)
    at getFresh (/Users/towalter/workspace/mobile.de/freshy-test/node_modules/freshy/index.js:16:12)
    at resolve (/Users/towalter/workspace/mobile.de/freshy-test/node_modules/freshy/index.js:93:19)
    at exports.create (/Users/towalter/workspace/mobile.de/freshy-test/node_modules/makara/node_modules/adaro/lib/engine.js:43:16)
    at Object.<anonymous> (/Users/towalter/workspace/mobile.de/freshy-test/index.js:3:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

screen shot 2015-07-15 at 16 23 45

@aredridel
Copy link
Contributor

Ooh, it looks like freshy doesn't resolve inter-module paths like I thought it did when I used it in makara. This would work with npm 3, which is why I didn't notice it.

@totherik
Copy link
Contributor

thanks to @aredridel, this should be fixed by #4 and is published as version 1.0.1

@nerdgore
Copy link
Author

Thats what I call fast response. Thank you both.

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

3 participants