Skip to content

ng generate: "input.mergeMap is not a function" #8912

Closed

Description

@evolkmann

Versions

Angular CLI: 1.6.0
Node: 8.9.1
OS: win32 x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router, upgrade

@angular/cli: 1.6.0
@angular/flex-layout: 2.0.0-rc.1
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0

Repro steps

  • Install Angular and CLI as described above
  • Try ng generate component test

Observed behavior

  • ng generate ... crashes with the error message input.mergeMap is not a function.
  • The error happens for the generate command in general, not just for ng g c for example
  • No files are created
  • The complete output is:
C:\Users\Enzo\WebstormProjects\test-project>ng g c test
input.mergeMap is not a function
TypeError: input.mergeMap is not a function
    at Object.callRule (C:\Users\Enzo\WebstormProjects\test-project\node_modules\@angular-devkit\schematics\src\rules\call.js:78:18)
    at SchematicImpl.call (C:\Users\Enzo\WebstormProjects\test-project\node_modules\@angular-devkit\schematics\src\engine\schematic.js:35:23)
    at Promise (C:\Users\Enzo\WebstormProjects\test-project\node_modules\@angular\cli\tasks\schematic-run.js:73:23)
    at new Promise (<anonymous>)
    at Class.run (C:\Users\Enzo\WebstormProjects\test-project\node_modules\@angular\cli\tasks\schematic-run.js:72:16)
    at Class.run (C:\Users\Enzo\WebstormProjects\test-project\node_modules\@angular\cli\commands\generate.js:152:33)
    at resolve (C:\Users\Enzo\WebstormProjects\test-project\node_modules\@angular\cli\ember-cli\lib\models\command.js:261:20)
    at new Promise (<anonymous>)
    at Class.validateAndRun (C:\Users\Enzo\WebstormProjects\test-projectnode_modules\@angular\cli\ember-cli\lib\models\command.js:240:12)
    at Promise.resolve.then.then (C:\Users\Enzo\WebstormProjects\test-projectnode_modules\@angular\cli\ember-cli\lib\cli\cli.js:140:24)

Desired behavior

  • The ng generate command should generate files and adjust app.module.ts as usual

Additional information

  • Opened a new issue as described in #8782

Activity

  1. added
    P1
    on Dec 21, 2017
  2. Brocco commented on Dec 21, 2017

    @Brocco
    Contributor

    Can you please post the results of running:

    npm ls rxjs
    

    Also, could you post the repository to github and share?

  3. added
    needs: more info
    on Dec 21, 2017
  4. neo-clon commented on Dec 21, 2017

    @neo-clon

    I have the same error :(

    input.mergeMap is not a function TypeError: input.mergeMap is not a function at Object.callRule (D:\Source\Repos\Trade\ibelectron\node_modules\@angular-devkit\schematics\src\rules\call.js:78:18) at SchematicImpl.call (D:\Source\Repos\Trade\ibelectron\node_modules\@angular-devkit\schematics\src\engine\schematic.js:35:23) at Promise (D:\Source\Repos\Trade\ibelectron\node_modules\@angular\cli\tasks\schematic-run.js:73:23) at new Promise (<anonymous>) at Class.run (D:\Source\Repos\Trade\ibelectron\node_modules\@angular\cli\tasks\schematic-run.js:72:16) at Class.run (D:\Source\Repos\Trade\ibelectron\node_modules\@angular\cli\commands\generate.js:161:33) at resolve (D:\Source\Repos\Trade\ibelectron\node_modules\@angular\cli\ember-cli\lib\models\command.js:261:20) at new Promise (<anonymous>) at Class.validateAndRun (D:\Source\Repos\Trade\ibelectron\node_modules\@angular\cli\ember-cli\lib\models\command.js:240:12) at Promise.resolve.then.then (D:\Source\Repos\Trade\ibelectron\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:140:24)

    +-- @angular/cli@1.6.2
    | +-- @angular-devkit/schematics@0.0.42
    | | `-- rxjs@5.5.2
    | `-- rxjs@5.5.2
    `-- rxjs@5.5.5
    
  5. mikenauman commented on Dec 21, 2017

    @mikenauman

    I was having the same error. This was the result from npm ls rxjs:

    ├─┬ @angular/cli@1.6.0
    │ ├─┬ UNMET PEER DEPENDENCY @angular-devkit/schematics@0.0.41
    │ │ ├── UNMET PEER DEPENDENCY @angular-devkit/schematics@0.0.40
    │ │ └── rxjs@5.5.5
    │ └── rxjs@5.5.5
    ├── UNMET PEER DEPENDENCY @angular/compiler@5.1.0
    ├── UNMET PEER DEPENDENCY @angular/core@5.1.0
    └── rxjs@5.5.5

    I ran:
    npm update

    And now it works.

  6. neo-clon commented on Dec 21, 2017

    @neo-clon

    Thanks! I ran yarn upgrade and now works :)

  7. evolkmann commented on Dec 22, 2017

    @evolkmann
    Author

    Output of npm ls rxjs:

    test-project@0.1.0 C:\Users\Enzo\WebstormProjects\test-project
    +-- @angular/cli@1.6.0
    | `-- rxjs@5.5.5
    `-- rxjs@5.5.0
    

    As suggested, I ran npm update, but this had no effect for me.

  8. evolkmann commented on Dec 22, 2017

    @evolkmann
    Author

    @Brocco I can not publish the original repo, but I created a new project and copied the exact dependecies:

    https://github.com/evolkmann/test-ng-generate

    In this particular setup, the error happens and can be reproduced.

    ng -v prints:

    Angular CLI: 1.6.0
    Node: 8.9.1
    OS: win32 x64
    Angular: 5.1.0
    ... animations, common, compiler, compiler-cli, core, forms
    ... http, platform-browser, platform-browser-dynamic
    ... platform-server, router, upgrade
    
    @angular/cli: 1.6.0
    @angular/flex-layout: 2.0.0-rc.1
    @angular-devkit/build-optimizer: 0.0.36
    @angular-devkit/core: 0.0.22
    @angular-devkit/schematics: 0.0.42
    @ngtools/json-schema: 1.1.0
    @ngtools/webpack: 1.9.0
    @schematics/angular: 0.1.11
    @schematics/schematics: 0.0.11
    typescript: 2.4.2
    webpack: 3.10.0
    
  9. added a commit that references this issue on Dec 22, 2017
    09aa861
  10. numzbk commented on Dec 26, 2017

    @numzbk

    yarn upgrade it work for me

  11. added a commit that references this issue on Dec 28, 2017
    9793dcf
  12. solkaz commented on Jan 11, 2018

    @solkaz

    After running yarn upgrade and then trying to generate a module, I get:

    yarn run v1.3.2
    $ ng g m MyModule --dry-run
    Error: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    error Command failed with exit code 1.
    

    Running ng --version:

        _                      _                 ____ _     ___
       / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
      / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
     / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
    /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                   |___/
    
    Angular CLI: 1.6.3
    Node: 8.9.0
    OS: darwin x64
    Angular: 5.2.0
    ... animations, common, compiler, compiler-cli, core, forms
    ... http, language-service, platform-browser
    ... platform-browser-dynamic, router
    
    @angular/cli: 1.6.3
    @angular/flex-layout: 2.0.0-beta.12
    @angular-devkit/build-optimizer: 0.0.37
    @angular-devkit/core: 0.0.24
    @angular-devkit/schematics: 0.0.44
    @ngtools/json-schema: 1.1.0
    @ngtools/webpack: 1.9.3
    @schematics/angular: 0.1.12
    typescript: 2.5.3
    webpack: 3.10.0
    
  13. added 9 commits that reference this issue on Jan 12, 2018
    161ff9f
    2745331
    10befd8
    0297d3d
    5846f71
    b5050fa
    4247b27
    f6332b5
    999da5c
  14. added a commit that references this issue on Jan 25, 2018
    0b63f04
  15. added a commit that references this issue on Apr 23, 2018
    a237107
  16. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  17. locked and limited conversation to collaborators on Sep 7, 2019
  18. added a commit that references this issue on May 29, 2026
    a3d3d91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1needs: more infotype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions