Title: Error: moduleId should be a string · Issue #3576 · angular/angular-cli · GitHub
Open Graph Title: Error: moduleId should be a string · Issue #3576 · angular/angular-cli
X Title: Error: moduleId should be a string · Issue #3576 · angular/angular-cli
Description: OS macOS Sierra (10.12.2) Versions angular-cli: 1.0.0-beta.22-1 node: 6.3.1 os: darwin x64 Repro steps ng init # Original project where I encountered the bug ng serve or ng new someApp # Test to check if related to the project ng serve W...
Open Graph Description: OS macOS Sierra (10.12.2) Versions angular-cli: 1.0.0-beta.22-1 node: 6.3.1 os: darwin x64 Repro steps ng init # Original project where I encountered the bug ng serve or ng new someApp # Test to ch...
X Description: OS macOS Sierra (10.12.2) Versions angular-cli: 1.0.0-beta.22-1 node: 6.3.1 os: darwin x64 Repro steps ng init # Original project where I encountered the bug ng serve or ng new someApp # Test to ch...
Opengraph URL: https://github.com/angular/angular-cli/issues/3576
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error: moduleId should be a string","articleBody":"### OS\r\n> macOS Sierra (10.12.2)\r\n\r\n\r\n### Versions\r\n\r\n> angular-cli: 1.0.0-beta.22-1 \r\n> node: 6.3.1 \r\n> os: darwin x64\r\n\r\n### Repro steps\r\n\r\n```bash\r\nng init # Original project where I encountered the bug\r\nng serve\r\n```\r\n\r\nor \r\n\r\n```bash\r\nng new someApp # Test to check if related to the project\r\nng serve\r\n```\r\n\r\nWith this modification in `src/app/app.component.ts`: \r\n\r\n```diff\r\n@Component({\r\n+ moduleId: module.id,\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['./app.component.css']\r\n})\r\n```\r\n\r\n### The log given by the failure\r\n\r\n```log\r\nError: moduleId should be a string in \"AppComponent\". See https://goo.gl/wIDDiL for more information.\r\nIf you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.\r\ncomponentModuleUrl — metadata_resolver.js:847\r\ngetNonNormalizedDirectiveMetadata — metadata_resolver.js:198\r\n_loadDirectiveMetadata — metadata_resolver.js:134\r\nmap\r\nloadNgModuleMetadata — metadata_resolver.js:315\r\n_loadModules — runtime_compiler.js:99\r\n_compileModuleAndComponents — runtime_compiler.js:69\r\ncompileModuleAsync — runtime_compiler.js:59\r\n_bootstrapModuleWithZone — application_ref.js:302\r\n(fonction anonyme) — main.ts:12\r\n__webpack_require__ — bootstrap e91d12277f564bbde63b:52\r\n(fonction anonyme) — app.component.html:1\r\n__webpack_require__ — bootstrap e91d12277f564bbde63b:52\r\nwebpackJsonpCallback — bootstrap e91d12277f564bbde63b:23\r\nCode général — main.bundle.js:1\r\n```\r\n\r\n### Useful details\r\n\r\nI was trying to use angular-cli on an existing Angular2 project, to use the built-in server instead of `lite-server` (which I used before, as it's the method shown in the docs), and after some adjustments, I ended up with this error in the browser (Safari) while the Terminal said everything looked fine.\r\n\r\nSo I tried setting up a new Angular 2 project using `ng new` to compare my code and see what went wrong, but when I tried running the sample project I got the same result.\r\n\r\nHere are the logs I get while running the sample project with `ng serve`:\r\n\r\n```log\r\nHash: e91d12277f564bbde63b / Time: 7492ms \r\nchunk {0} main.bundle.js, main.bundle.map (main) 4.75 kB {2} [initial] [rendered]\r\nchunk {1} styles.bundle.js, styles.bundle.map (styles) 9.99 kB {3} [initial] [rendered]\r\nchunk {2} vendor.bundle.js, vendor.bundle.map (vendor) 2.22 MB [initial] [rendered]\r\nchunk {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]\r\nwebpack: bundle is now VALID.\r\n```\r\n\r\nAny idea what could have been done wrong?","author":{"url":"https://github.com/viki53","@type":"Person","name":"viki53"},"datePublished":"2016-12-15T15:51:44Z","url":"https://github.com/angular/angular-cli/issues/3576"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:884f6e7c-d9ab-6a53-9ec7-0cd9440b8fcd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E04:2AF0D8:115E60B:15BE2F9:6B0241BC |
| html-safe-nonce | 15a75bd147fff9fae096384f161672e59324641da1d220930d1645a80941ef6b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTA0OjJBRjBEODoxMTVFNjBCOjE1QkUyRjk6NkIwMjQxQkMiLCJ2aXNpdG9yX2lkIjoiMzc2OTI1NDAxOTM0MDU4MzM1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fb6cb8a219cd7bf16edf2933ce5649f1d8790a0b831b6f6c7b791ef08e0749e9 |
| hovercard-subject-tag | issue:195840711 |
| 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/3576/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d6683e5cef1c45457a2dd8cf6edd17a537f4b61564b6fb250308ec9d60fff2d4/angular/angular-cli/issues/3576 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d6683e5cef1c45457a2dd8cf6edd17a537f4b61564b6fb250308ec9d60fff2d4/angular/angular-cli/issues/3576 |
| og:image:alt | OS macOS Sierra (10.12.2) Versions angular-cli: 1.0.0-beta.22-1 node: 6.3.1 os: darwin x64 Repro steps ng init # Original project where I encountered the bug ng serve or ng new someApp # Test to ch... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | viki53 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width