{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/7138","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/7138/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/7138/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/7138/events","html_url":"https://github.com/angular/angular-cli/issues/7138","id":245471083,"number":7138,"title":"Environment flags not working","user":{"login":"VictorJuliani","id":7915114,"avatar_url":"https://avatars0.githubusercontent.com/u/7915114?v=4","gravatar_id":"","url":"https://api.github.com/users/VictorJuliani","html_url":"https://github.com/VictorJuliani","followers_url":"https://api.github.com/users/VictorJuliani/followers","following_url":"https://api.github.com/users/VictorJuliani/following{/other_user}","gists_url":"https://api.github.com/users/VictorJuliani/gists{/gist_id}","starred_url":"https://api.github.com/users/VictorJuliani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VictorJuliani/subscriptions","organizations_url":"https://api.github.com/users/VictorJuliani/orgs","repos_url":"https://api.github.com/users/VictorJuliani/repos","events_url":"https://api.github.com/users/VictorJuliani/events{/privacy}","received_events_url":"https://api.github.com/users/VictorJuliani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-07-25T17:10:00Z","updated_at":"2017-07-25T22:57:24Z","closed_at":null,"body":"### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [x] bug report -> please search issues before submitting\r\n- [ ] feature request\r\n```\r\n\r\n### Versions.\r\n```\r\n@angular/cli: 1.2.4\r\nnode: 6.10.3\r\nos: win32 x64\r\n@angular/animations: 4.3.1\r\n@angular/common: 4.3.1\r\n@angular/compiler: 4.3.1\r\n@angular/core: 4.3.1\r\n@angular/forms: 4.3.1\r\n@angular/http: 4.3.1\r\n@angular/platform-browser: 4.3.1\r\n@angular/platform-browser-dynamic: 4.3.1\r\n@angular/router: 4.3.1\r\n@angular/cli: 1.2.4\r\n@angular/compiler-cli: 4.3.1\r\n@angular/language-service: 4.3.1\r\n```\r\n\r\n### Repro steps.\r\n1. Create a new project through **ng new** and install dependencies\r\n2. **Import** environments/environment in app.component\r\n3. Add some conditional behavior depending on the environment\r\n4. Serve the project with env attribute (tried all these)\r\n```\r\nng serve --e=prod --env=prod -e=prod -env=prod --environment=prod -environment=pro\r\nd\r\n```\r\n\r\n### Desired functionality.\r\nIt should import the correct environment properties accordingly to the flag used.\r\n\r\n### Mention any other details that might be useful.\r\nIt stopped working after a yarn upgrade ran on my project and then I tested with a fresh new project generated by the cli.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular-cli/issues/comments/317897076","html_url":"https://github.com/angular/angular-cli/issues/7138#issuecomment-317897076","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/7138","id":317897076,"user":{"login":"etaylor8086","id":5769306,"avatar_url":"https://avatars0.githubusercontent.com/u/5769306?v=4","gravatar_id":"","url":"https://api.github.com/users/etaylor8086","html_url":"https://github.com/etaylor8086","followers_url":"https://api.github.com/users/etaylor8086/followers","following_url":"https://api.github.com/users/etaylor8086/following{/other_user}","gists_url":"https://api.github.com/users/etaylor8086/gists{/gist_id}","starred_url":"https://api.github.com/users/etaylor8086/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etaylor8086/subscriptions","organizations_url":"https://api.github.com/users/etaylor8086/orgs","repos_url":"https://api.github.com/users/etaylor8086/repos","events_url":"https://api.github.com/users/etaylor8086/events{/privacy}","received_events_url":"https://api.github.com/users/etaylor8086/received_events","type":"User","site_admin":false},"created_at":"2017-07-25T22:57:24Z","updated_at":"2017-07-25T22:57:24Z","body":"Running node 6.10.2. I narrowed down the issue to webpack using `enhanced-resolve@3.4.1` on my project. Deleting my `node_modules/` directory and running `npm install` will still install the `3.4.1` version of this package from as far back as `@angular/cli@1.1.2`, from what I've tested.\r\n\r\nI can't say the following solution is good, but as a temporary workaround I've simply installed `enhanced-resolve@3.3.0` as a dev dependency:\r\n\r\n`npm install --save-dev enhanced-resolve@3.3.0`\r\n\r\nI'm not using this package anywhere else in my project, so this works for me until I find a better way. Maybe I could set up a `npm-shrinkwrap.json` and force webpack to use `enhanced-resolve@3.3.0`?"}}
{"actor":{"display_login":"etaylor8086"}}