Closed nriesco closed 7 years ago
Could you let us know if you’re still having this issue with DocumentJS 0.5 please?
@chasenlehara it has been a long time since I last used documentjs in watch mode, that was when it started triggering this error. I can't replicate que problem at this point sorry I didn't provide more details in this issue. I guess we can close this issue and if I'm able to replicate any errors I'll create a new issue.
@chasenlehara you won't believe it but I got the error again when running it normally (not even using the watch option). This time I've got some sort of feedback that might help. Somehow it is complaining about can-connect-feathers
although I'm not sure about why.
The module can-connect-feathers
is part of the dependencies of the application so it doesn't really make sense not finding it.
I've got a model like this:
// models/feathers.js
import Feathers from 'can-connect-feathers';
import JQuery from 'jquery';
import loader from '@loader';
const feathers = new Feathers({
url: loader.urlApi,
tokenLocation: 'feathers-jwt',
idProp: '_id',
jquery: JQuery,
});
export default feathers;
I also tried to change this line:
from import Feathers from 'can-connect-feathers';
to import Feathers from 'another-name';
then re run documentjs and still get the same error. Maybe some sort of cache?
Btw: my project is a donejs project.
node: v6.11.2 npm: 3.10.10 documentjs: 0.5
/Users/nriesco/git/riescorp/ozzi-application/node_modules/q/q.js:126
throw e;
^
Error: Cannot find module 'can-connect-feathers'
at Function.Module._resolveFilename (module.js:469:15)
at Function.resolve (internal/module.js:27:19)
at module.exports (/Users/nriesco/git/riescorp/ozzi-application/node_modules/documentjs/site/static/build/99914b932bd37a50b983c5e7c90ae93b/build.js:42:28)
at /Users/nriesco/git/riescorp/ozzi-application/node_modules/documentjs/lib/generators/html/build/static_dist.js:92:11
at _fulfilled (/Users/nriesco/git/riescorp/ozzi-application/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/Users/nriesco/git/riescorp/ozzi-application/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/Users/nriesco/git/riescorp/ozzi-application/node_modules/q/q.js:749:13)
at /Users/nriesco/git/riescorp/ozzi-application/node_modules/q/q.js:557:44
at flush (/Users/nriesco/git/riescorp/ozzi-application/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
@chasenlehara any idea on how to debug this? it is somehow using "q" but where should I look for it? thanks
A project with this issue would be really helpful; I just created a new DoneJS app, added DocumentJS, installed can-connect-feathers
, and generated the docs successfully.
The stack trace you posted (thank you!) is pointing at this line: https://github.com/bitovi/documentjs/blob/45e8ae13d1bc2c3b992bedab42cffcd169b52aee/site/default/static/build.js#L42
Theoretically Node should be able to find any package that’s installed and in your package.json
, so I’m not sure what’s causing this issue. I can help figure out what’s going on if I can get a project where it’s failing.
@chasenlehara here's link to the project that I'm using https://github.com/bitovi/vintage-shop/tree/sgdd-tutorial. When running documentjs
the following error is being thrown:
/Users/USERNAME/.nvm/versions/node/v6.11.0/lib/node_modules/documentjs/node_modules/q/q.js:126
throw e;
^
Error: Cannot find module 'can-connect'
at Function.Module._resolveFilename (module.js:469:15)
at Function.resolve (internal/module.js:27:19)
at module.exports (/Users/ USERNAME/.nvm/versions/node/v6.11.0/lib/node_modules/documentjs/site/static/build/d8884a64843b4a3cbd7d0dcbbdc5b678/build.js:42:28)
at /Users/ USERNAME/.nvm/versions/node/v6.11.0/lib/node_modules/documentjs/lib/generators/html/build/static_dist.js:92:11
at _fulfilled (/Users/ USERNAME/.nvm/versions/node/v6.11.0/lib/node_modules/documentjs/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/Users/ USERNAME/.nvm/versions/node/v6.11.0/lib/node_modules/documentjs/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/Users/USERNAME/.nvm/versions/node/v6.11.0/lib/node_modules/documentjs/node_modules/q/q.js:749:13)
at /Users/ USERNAME/.nvm/versions/node/v6.11.0/lib/node_modules/documentjs/node_modules/q/q.js:557:44
at flush (/Users/ USERNAME/.nvm/versions/node/v6.11.0/lib/node_modules/documentjs/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:73:7)```
I think I found the problem.
@nriesco, I think the problem in your project is caused by can-connect-feathers
not specifying the right main
field in its package.json
so I’ve opened a PR: https://github.com/canjs/can-connect-feathers/pull/83
@adrifolio, that project works with DocumentJS 0.4, but 0.5 runs into the same main
issue with the version of can-connect
used in that project; we’ve fixed it in newer versions of can-connect
, so upgrading that makes the local npm run document
command work.
However, if you try to use the global documentjs
CLI, it’ll fail on a different module. I’ll need help next week figuring out what the correct fix for this problem is.
Hi @nriesco and @adrifolio, I think we’ve released fixes for everything reported in this thread. DocumentJS 0.5.1 fixes the global CLI issue and can-connect-feathers
was patched with the main
fix.
Please feel free to reopen this or create a new issue if you’re still experiencing problems.
Hi, I'm trying to run documentjs but I get a steal related error. I guess I have some syntax error or something in my docs but I cannot figure out wicho of the hundreds of files is wrong because I get this error and no additional info: