angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.71k stars 11.98k forks source link

AppShellPlugin fails when using templateUrl or styleUrls in app shell component #955

Closed Splaktar closed 8 years ago

Splaktar commented 8 years ago
  1. OS? Mac OSX El Capitan
  2. Versions. angular-cli: 1.0.0-beta.5 <- actually master, based on 67b577deb3bbee27228ec0b559bca6ba90603dcc node: 4.4.3 os: darwin x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
    1. ng new --mobile nexus
    2. add src/nexus.component.html
    3. In src/nexus.component.ts change template to use templateUrl: 'nexus.component.html',
    4. ng build

Same happens when using styleUrls: ['nexus.component.css'],

  1. The log given by the failure. Normally this include a stack trace and some more information.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Build failed.
The Broccoli Plugin: [AppShellPlugin] failed with:
Error: Command failed: /bin/sh -c node /Users/splaktar/Git/gdg-x/nexus/node_modules/angular2-broccoli-prerender/dist/child_proc.js  --sourceHtml=/Users/splaktar/Git/gdg-x/nexus/tmp/app_shell_plugin-input_base_path-aapqpBuT.tmp/0/index.html --optionsPath=/Users/splaktar/Git/gdg-x/nexus/tmp/app_shell_plugin-input_base_path-aapqpBuT.tmp/0/main-app-shell --outputIndexPath=/Users/splaktar/Git/gdg-x/nexus/tmp/app_shell_plugin-output_path-WwgJsbgY.tmp/index.html
EXCEPTION: Failed to load /Users/splaktar/Git/gdg-x/nexus/tmp/broccoli_type_script_compiler-cache_path-P5p4ZXLd.tmp/src/app/nexus.component.html
Failed to load /Users/splaktar/Git/gdg-x/nexus/tmp/broccoli_type_script_compiler-cache_path-P5p4ZXLd.tmp/src/app/nexus.component.html

    at ChildProcess.exithandler (child_process.js:213:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:827:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:477:12)

The broccoli plugin was instantiated at: 
    at AppShellPlugin.Plugin (/Users/splaktar/Git/gdg-x/nexus/node_modules/broccoli-plugin/index.js:10:31)
    at AppShellPlugin.CachingWriter [as constructor] (/Users/splaktar/Git/gdg-x/nexus/node_modules/broccoli-caching-writer/index.js:21:10)
    at new AppShellPlugin (/Users/splaktar/Git/gdg-x/nexus/node_modules/angular2-broccoli-prerender/dist/prerender.js:15:16)
    at Angular2App._buildTree (/Users/splaktar/Git/gdg-x/nexus/node_modules/angular-cli/lib/broccoli/angular2-app.js:153:48)
    at new Angular2App (/Users/splaktar/Git/gdg-x/nexus/node_modules/angular-cli/lib/broccoli/angular2-app.js:53:23)
    at module.exports (/Users/splaktar/Git/gdg-x/nexus/angular-cli-build.js:6:10)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/splaktar/Git/gdg-x/nexus/node_modules/angular-cli/lib/models/builder.js:55:19)
    at Class.module.exports.Task.extend.init (/Users/splaktar/Git/gdg-x/nexus/node_modules/angular-cli/lib/models/builder.js:89:10)
    at new Class (/Users/splaktar/Git/gdg-x/nexus/node_modules/core-object/core-object.js:18:12)
    at Class.module.exports.Task.extend.run (/Users/splaktar/Git/gdg-x/nexus/node_modules/angular-cli/lib/tasks/build.js:15:19)
    at /Users/splaktar/Git/gdg-x/nexus/node_modules/angular-cli/lib/commands/build.js:32:24
    at lib$rsvp$$internal$$tryCatch (/Users/splaktar/Git/gdg-x/nexus/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/splaktar/Git/gdg-x/nexus/node_modules/rsvp/dist/rsvp.js:1048:17)
    at /Users/splaktar/Git/gdg-x/nexus/node_modules/rsvp/dist/rsvp.js:331:11
    at lib$rsvp$asap$$flush (/Users/splaktar/Git/gdg-x/nexus/node_modules/rsvp/dist/rsvp.js:1198:9)
    at nextTickCallbackWith0Args (node.js:420:9)
  1. Mention any other details that might be useful. This repo has full reproduction ready and can be used for debugging: https://github.com/gdg-x/nexus/tree/e07c254ffbcd8817c2ab0b7cf012c97c02b3f136

Perhaps I am just doing it wrong. It seems like I can just include the full HTML/CSS in the component.ts file to work around this, but I would prefer to avoid that.

bielcapanema commented 8 years ago

same here, but a resolve the:

"Could not start watchman; falling back to NodeWatcher for file system events. Visit http://ember-cli.com/user-guide/#watchman for more info."

just running: brew install watchman or if u prefer with ports.

following here.

duergner commented 8 years ago

same here (at least with the app I created yesterday as app creation is failing as of today)

filipesilva commented 8 years ago

Duplicate of https://github.com/angular/angular-cli/issues/810

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.