This repository has been archived by the owner on Oct 20, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add instructions to use lbclient, refer: #3
- Loading branch information
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@klarkc mmmh...
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nigeltiany look for the code in that line, maybe this information can help us. In my bundle.js there is not a readFileSync call in the line 19829
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a really dynamic file that's project dependent. here is mine
@klarkc
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nigeltiany My installation does not have the module pkginfo, it's installed in your node_modules? Who depends on it? Show your dependency tree:
$ npm list pkginfo
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@klarkc and my terminal truncated some
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nigeltiany that winston is not in our package.json, try remove it:
$ npm uninstall winston
. Maybe a better way is to clean node_modules, reload package.json from this repo and install all again withnpm install
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It causes problems working without it. Running
gulp lbclient
throws errorsWhy do you suspect pkginfo@0.3.1? @klarkc
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, Loopback does not use the fs module in the client environment, so this pkginfo is the only module that tries to use fs in client, throwing the error. The thing is, you don't need this module (pkginfo) in your client if it's not being used by loopback, maybe this cause an overhead of modules in your bundle (You said before that your bundle is 100k > lines, my bundle has ~80k of lines).
I am guessing that, pkginfo is only used by this winston package, that I don't know why is being bundled in the client. Some script is requiring this module in
client/loopback
directory orcommon
directory.You have two ways to fix this, use brfs or remove the modules that tries to use fs module.
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe related: winstonjs/winston#287
662ac70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @klarkc. For your time, patience and knowledge. I appreciate. I'll look into this and let you know when i fix it.