{"action":"created","issue":{"url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/2727","repository_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack","labels_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/2727/labels{/name}","comments_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/2727/comments","events_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/2727/events","html_url":"https://github.com/angular-fullstack/generator-angular-fullstack/issues/2727","id":331591829,"node_id":"MDU6SXNzdWUzMzE1OTE4Mjk=","number":2727,"title":"Issue with using visionmedia/debug package","user":{"login":"roshan-cinq","id":20609928,"node_id":"MDQ6VXNlcjIwNjA5OTI4","avatar_url":"https://avatars2.githubusercontent.com/u/20609928?v=4","gravatar_id":"","url":"https://api.github.com/users/roshan-cinq","html_url":"https://github.com/roshan-cinq","followers_url":"https://api.github.com/users/roshan-cinq/followers","following_url":"https://api.github.com/users/roshan-cinq/following{/other_user}","gists_url":"https://api.github.com/users/roshan-cinq/gists{/gist_id}","starred_url":"https://api.github.com/users/roshan-cinq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roshan-cinq/subscriptions","organizations_url":"https://api.github.com/users/roshan-cinq/orgs","repos_url":"https://api.github.com/users/roshan-cinq/repos","events_url":"https://api.github.com/users/roshan-cinq/events{/privacy}","received_events_url":"https://api.github.com/users/roshan-cinq/received_events","type":"User","site_admin":false},"labels":[{"id":62928210,"node_id":"MDU6TGFiZWw2MjkyODIxMA==","url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-12T13:38:44Z","updated_at":"2018-06-13T06:13:59Z","closed_at":null,"author_association":"NONE","body":" - [x] I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.\r\n\r\nItem | Version\r\n----- | -----\r\ngenerator-angular-fullstack | 4.2.2\r\nNode | 6.9.0\r\nnpm | 6.1.0\r\nOperating System | Windows 7 \r\n\r\nItem | Answer\r\n----- | -----\r\nTranspiler | Babel \r\n\r\nI have an issue with using the `visionmedia/debug` library. While running tests, the gulp task sets the environment variables from `local.env.js`. It does not work if I set say `app:*`, but works if I set it to `*`. It also works fine if I set it manually by `set DEBUG=app:*` before running the task.\r\n\r\nSome digging through the `debug` module showed that it was only working for node modules which had their own nested `debug`. It doesn't work for the main app or any node module which uses the top level `debug` . Some more digging leads me to believe that babel loads the top level `debug` before the gulp task runs.\r\n\r\nIs there a workaround for this apart from manually setting env?"},"comment":{"url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/comments/396825377","html_url":"https://github.com/angular-fullstack/generator-angular-fullstack/issues/2727#issuecomment-396825377","issue_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/2727","id":396825377,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjgyNTM3Nw==","user":{"login":"roshan-cinq","id":20609928,"node_id":"MDQ6VXNlcjIwNjA5OTI4","avatar_url":"https://avatars2.githubusercontent.com/u/20609928?v=4","gravatar_id":"","url":"https://api.github.com/users/roshan-cinq","html_url":"https://github.com/roshan-cinq","followers_url":"https://api.github.com/users/roshan-cinq/followers","following_url":"https://api.github.com/users/roshan-cinq/following{/other_user}","gists_url":"https://api.github.com/users/roshan-cinq/gists{/gist_id}","starred_url":"https://api.github.com/users/roshan-cinq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roshan-cinq/subscriptions","organizations_url":"https://api.github.com/users/roshan-cinq/orgs","repos_url":"https://api.github.com/users/roshan-cinq/repos","events_url":"https://api.github.com/users/roshan-cinq/events{/privacy}","received_events_url":"https://api.github.com/users/roshan-cinq/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T06:13:59Z","updated_at":"2018-06-13T06:13:59Z","author_association":"NONE","body":"The [visionmedia/debug](https://github.com/visionmedia/debug) package enables console logging selectively based on the value of the environment variable `DEBUG`. Its very useful while dev/test to set the variable to see only the logs you want to.\r\n\r\nThe generator already provides a convenient option to set the `DEBUG` or any env variable [here](https://github.com/angular-fullstack/generator-angular-fullstack/blob/a3f392c8909a820499e372ef99ccd6c18adc22a8/templates/app/server/config/_local.env.js#L21). And the gulp task [`env:all`](https://github.com/angular-fullstack/generator-angular-fullstack/blob/a3f392c8909a820499e372ef99ccd6c18adc22a8/templates/app/gulpfile.babel.js#L173) sets it from this file. So I am assuming the authors meant for this package to be used if need be. \r\n\r\nBut the task does not behave as expected. The debug package is initialized on first load, where it checks the env variable. But while running the `gulp test` task, the top level node modules are loaded (by babel I think) before the task itself executes. So effectively the env variable has not been set when the module loads and no logs basically."}}
{"actor":{"display_login":"roshan-cinq"}}