duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

Potential glob/require from another directory issue? #444

Closed clocklear closed 9 years ago

clocklear commented 9 years ago

I have bootstrap JS file that requires a bunch of modules I'm using in my application. For simplicity, I've edited it down to one line:

require("../.tmp/modules/state-select/state-select.js");

When I run duo on this file, it never finishes (or takes an extraordinary long time -- 50+ seconds):

  duo-package read auth details from ~/.netrc +0ms

     building : core-modules.js  duo running: core-modules.js +314ms

        using : component_compat  duo using plugin: component_compat +1ms

        using : stoj  duo using plugin: stoj +0ms
  duo parsing: core-modules.js +2ms
  duo core-modules.js deps: ["../.tmp/modules/state-select/state-select.js"] +10ms
  duo core-modules.js: local dependency "../.tmp/modules/state-select/state-select.js" +1ms

If I go directly to the ../.tmp/modules/state-select directory in my shell though and run duo directly on state-select.js, it runs fine -- no problems. Perhaps there is something weird with globbing or requiring from another directory (or parent directory)?

This wasn't happening a few days ago. I'm not ruling out the possibility that something else on my machine is fubarred.

I'm using node v0.10.36.

dominicbarnes commented 9 years ago

Is .tmp contained within your project root?

Could you include the duo command you are running?

clocklear commented 9 years ago

False alarm, thanks for the poke in the right direction. In my example .tmp would not have been in the project root, so I assume all sorts of bad things were happening.

It's rather obvious now that its several hours later. I'm chalking it up to a long day at work. Thanks again!

dominicbarnes commented 9 years ago

Yeah, in duo the root is a pretty rigid concept. (practically the same as "chroot")

I will see if we can get a proper error to report such a scenario in order to reduce this type of confusion.