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

Nested Resources with Express-Namespace #56

Open
azampagl opened this issue Mar 10, 2012 · 2 comments
Open

Nested Resources with Express-Namespace #56

azampagl opened this issue Mar 10, 2012 · 2 comments

Comments

@azampagl
Copy link

When using both express-namespace and express resource, I get the following error when trying to implement nested resources:

.../node_modules/express-namespace/index.js:64
fn.namespace = curr;
^
TypeError: Cannot set property 'namespace' of undefined
at HTTPServer. (.../node_modules/express-namespace/index.js:64:20)
at HTTPServer.namespace (.../node_modules/express-namespace/index.js:29:6)
at HTTPServer.get (.../node_modules/express-namespace/index.js:57:10)
at Resource.add (.../node_modules/express-resource/index.js:188:17)
at HTTPServer. (...)
at HTTPServer.namespace (.../node_modules/express-namespace/index.js:29:6)
at ...

E.g
var forums = app.resource('forums', require('resources/forums'), { load: Forum.get });
var threads = app.resource('threads', require('resources/threads'), { load: Thread.get });

forums.add(threads);

"express": "2.5.2",
"express-resource": "0.2.4",
"express-namespace": "0.0.4",

@supr
Copy link

supr commented Mar 20, 2012

@azampagl commenting out line 64 on node_modules/express-namespace/index.js fixed it for me. I am not sure if this is the right fix for it.

@OliverJAsh
Copy link

I am also looking for express-resource integration with express-namespace. @supr, line 64 has probably changed since you fixed it!

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