Skip to content

ng build works, but ng build -prod doesn't #1321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
piontec opened this issue Jul 11, 2016 · 4 comments
Closed

ng build works, but ng build -prod doesn't #1321

piontec opened this issue Jul 11, 2016 · 4 comments

Comments

@piontec
Copy link

piontec commented Jul 11, 2016

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Ubuntu Linux 16.04 amd64
  2. Versions. Please run ng --version. If there's nothing outputted, please
    angular-cli: 1.0.0-beta.9
    node: 6.2.2
    os: linux x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    Unfortunately, it's hard to tell: I switched to angular-cli in a middle of the project. I can build and run it without hte "-prod" flag, but it fails with the flag - see below.
  4. The log given by the failure. Normally this include a stack trace and some
    more information.

$ ng build
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Built project successfully. Stored in "dist/".

$ ng build -prod
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: [BundlePlugin] failed with:
TypeError: Cannot read property 'forEach' of undefined
at Trace.getLoadDependencies (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/lib/trace.js:879:12)
at traverseTree (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/lib/arithmetic.js:360:16)
at /home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/lib/compile.js:156:5
at Array.forEach (native)
at getTreeModulesPostOrder (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/lib/compile.js:155:14)
at compileTree (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/lib/compile.js:197:17)
at /home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/lib/builder.js:625:12
at tryCatcher (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/node_modules/bluebird/js/release/promise.js:504:31)
at Promise._settlePromise (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/node_modules/bluebird/js/release/promise.js:561:18)
at Promise._settlePromise0 (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/node_modules/bluebird/js/release/promise.js:606:10)
at Promise._settlePromises (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/node_modules/bluebird/js/release/promise.js:685:18)
at Async._drainQueue (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/systemjs-builder/node_modules/bluebird/js/release/async.js:148:10)
at Immediate.Async.drainQueues as _onImmediate
at tryOnImmediate (timers.js:543:15)

The broccoli plugin was instantiated at:
at BundlePlugin.Plugin (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/broccoli-plugin/index.js:10:31)
at BundlePlugin.CachingWriter as constructor
at BundlePlugin (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/lib/broccoli/angular-broccoli-bundle.js:11:5)
at Angular2App._getBundleTree (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/lib/broccoli/angular2-app.js:435:22)
at Angular2App._buildTree (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/lib/broccoli/angular2-app.js:167:21)
at new Angular2App (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/lib/broccoli/angular2-app.js:53:23)
at module.exports (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/angular-cli-build.js:10:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
at Class.module.exports.Task.extend.init (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
at new Class (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/core-object/core-object.js:18:12)
at Class.module.exports.Task.extend.run (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/angular-cli/lib/tasks/build.js:15:19)
at /home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/angular-cli/lib/commands/build.js:32:24
at lib$rsvp$$internal$$tryCatch (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
at /home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:331:11
at lib$rsvp$asap$$flush (/home/piontec/devfactory/git/aline-insights-copy/dizzard-ui/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1198:9)

@filipesilva
Copy link
Contributor

filipesilva commented Jul 28, 2016

Closed as issue was made obsolete by #1455. The build system changed drastically in that PR.

@meghadureja
Copy link

@filipesilva
ng build doesn't work

$ng version
angular-cli: 1.0.0-beta.24
node: 4.2.6
os: linux x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5

$ng build

No errors
Error: No errors
at validate (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/extract-text-webpack-plugin/schema/validator.js:10:9)
at Function.ExtractTextPlugin.extract (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/extract-text-webpack-plugin/index.js:188:3)
at /home/meghad/testingWorkspace/scotchy-scotch/node_modules/angular-cli/models/webpack-build-utils.js:72:77
at Array.map (native)
at Object.makeCssLoaders (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/angular-cli/models/webpack-build-utils.js:69:53)
at Object.getWebpackCommonConfig (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/angular-cli/models/webpack-build-common.js:77:65)
at new NgCliWebpackConfig (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/angular-cli/models/webpack-config.js:22:49)
at Class.exports.default.Task.extend.run (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/angular-cli/tasks/build-webpack.js:18:22)
at Class.Command.extend.run (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/angular-cli/commands/build.js:60:26)
at Class. (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/angular-cli/ember-cli/lib/models/command.js:152:17)
at tryCatch (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/es6-promise/dist/es6-promise.js:410:12)
at invokeCallback (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/es6-promise/dist/es6-promise.js:425:13)
at /home/meghad/testingWorkspace/scotchy-scotch/node_modules/es6-promise/dist/es6-promise.js:172:16
at flush (/home/meghad/testingWorkspace/scotchy-scotch/node_modules/es6-promise/dist/es6-promise.js:121:5)
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickCallback (node.js:348:13)

@filipesilva
Copy link
Contributor

@meghadureja see #4264

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants