Title: ng serve / ng test - import resolving difference ? · Issue #3533 · angular/angular-cli · GitHub
Open Graph Title: ng serve / ng test - import resolving difference ? · Issue #3533 · angular/angular-cli
X Title: ng serve / ng test - import resolving difference ? · Issue #3533 · angular/angular-cli
Description: Please provide us with the following information: OS? Windows 10 Versions. angular-cli: 1.0.0-beta.22-1 node: 7.2.0 os: win32 x64 Repro steps. This import work with ng serve and not work with ng test: import {environment} from 'environme...
Open Graph Description: Please provide us with the following information: OS? Windows 10 Versions. angular-cli: 1.0.0-beta.22-1 node: 7.2.0 os: win32 x64 Repro steps. This import work with ng serve and not work with ng te...
X Description: Please provide us with the following information: OS? Windows 10 Versions. angular-cli: 1.0.0-beta.22-1 node: 7.2.0 os: win32 x64 Repro steps. This import work with ng serve and not work with ng te...
Opengraph URL: https://github.com/angular/angular-cli/issues/3533
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ng serve / ng test - import resolving difference ?","articleBody":"\u003e Please provide us with the following information:\r\n\u003e ---------------------------------------------------------------\r\n\r\n### OS?\r\nWindows 10\r\n### Versions.\r\nangular-cli: 1.0.0-beta.22-1\r\nnode: 7.2.0\r\nos: win32 x64\r\n\r\n### Repro steps.\r\n\r\nThis import work with ng serve and not work with ng test:\r\n`````\r\nimport {environment} from 'environments/environment';\r\n\r\n@Injectable()\r\nexport class OwnerService {\r\n\r\n private entity_url = environment.REST_API_URL + 'owners';\r\n\r\n`````\r\nWhen start ng test :\r\n`````\r\nERROR in ./src/app/owners/owner.service.ts\r\nModule not found: Error: Can't resolve 'environments/environment' in 'D:\\eclipse\\workspace\\spring-petclinic-angular2\\src\\app\\owners'\r\n @ ./src/app/owners/owner.service.ts 15:20-55\r\n @ ./src/app/app.component.ts\r\n @ ./src/app/app.component.spec.ts\r\n @ ./src \\.spec\\.ts\r\n @ ./src/test.ts\r\n`````\r\nWhen I change import as\r\n`````\r\nimport {environment} from './../../environments/environment'\r\n`````\r\nwork ok for both (but it's lo-o-ong :) )\r\n\r\nFile environment.ts in src/environments/ directory.\r\n\r\nWebpack config difference or something relate to #https://github.com/angular/angular-cli/pull/2470 ?","author":{"url":"https://github.com/vfedoriv","@type":"Person","name":"vfedoriv"},"datePublished":"2016-12-12T18:53:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/3533/angular-cli/issues/3533"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5d88c173-6423-ffd1-8b08-261f7110df0a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA12:29F8F9:5E474F:7A309F:6976D315 |
| html-safe-nonce | f41343fa2780969ce0511192627fe2cf0db71bc9973e0614bb0fbb2add58540e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTEyOjI5RjhGOTo1RTQ3NEY6N0EzMDlGOjY5NzZEMzE1IiwidmlzaXRvcl9pZCI6IjI3MzA1NTM2MjY1OTY5MjIxMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 149fc9779f4fd05cfc2ea5675071c8f867ff05b03dca324e88080a2f5398c76e |
| hovercard-subject-tag | issue:195054781 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/3533/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8977f8f9a16ef7eae7f8aa7a5d47aa4d763cf097b3f193148c3ced2f35080bbb/angular/angular-cli/issues/3533 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8977f8f9a16ef7eae7f8aa7a5d47aa4d763cf097b3f193148c3ced2f35080bbb/angular/angular-cli/issues/3533 |
| og:image:alt | Please provide us with the following information: OS? Windows 10 Versions. angular-cli: 1.0.0-beta.22-1 node: 7.2.0 os: win32 x64 Repro steps. This import work with ng serve and not work with ng te... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vfedoriv |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width