jaredhanson / electrolyte

Elegant dependency injection for Node.js.
MIT License
564 stars 61 forks source link

Node_module factory functions not instantiated #18

Open Mistborn94 opened 9 years ago

Mistborn94 commented 9 years ago

I am experiencing an issue where my factory components that are also node modules are not instantiated but the functions are marked as literals.

The statement module['@literal'] = true; in loaders/node_modules (line 6) is causing this. Changing it to if (module['@literal'] === undefined) module['@literal'] = true; should solve the problem.

Another option is to remove the above mentioned line entirely and use the container's _registerModule function. The default pattern for anything that is not a function is already literal there.

uetkaje commented 9 years ago

+1