question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[1.4.0-beta.2] "more than one module matches" error when it should not

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.4.0-beta.2 node: 8.4.0 os: darwin x64

Repro steps.

ng g component hello                                                                                                                                 
  create src/app/hello/hello.component.css (0 bytes)
  create src/app/hello/hello.component.html (24 bytes)
  create src/app/hello/hello.component.spec.ts (621 bytes)
  create src/app/hello/hello.component.ts (265 bytes)
  update src/app/app.module.ts (392 bytes)

ng g module shared
  create src/app/shared/shared.module.ts (190 bytes)

ng g component hi 
Error: More than one module matches. Use skip-import option to skip importing the component into the closest module.
More than one module matches. Use skip-import option to skip importing the component into the closest module.

The log given by the failure.

Error: More than one module matches. Use skip-import option to skip importing the component into the closest module.
More than one module matches. Use skip-import option to skip importing the component into the closest module.

Desired functionality.

Using 1.3.x the same command adds the component to the root module.

installing component
  create src/app/hi/hi.component.css
  create src/app/hi/hi.component.html
  create src/app/hi/hi.component.spec.ts
  create src/app/hi/hi.component.ts
  update src/app/app.module.ts

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19

github_iconTop GitHub Comments

126reactions
dekonunescommented, Sep 15, 2017

try ng g component hi --module app

92reactions
m98commented, Sep 17, 2017

As the warning says, It’s because you have more than one module

You can solve it by specifying the name of the module you want to import the component to it. ng generate component componentName --module=app.module

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: More than one module matches. Use skip-import ...
Use skip-import option to skip importing the component into the closest module. I'm using angular cli version: 1.4.1. angular.
Read more >
Angular Error More than one module matches. - YouTube
Shared Modules in Angular - How to do it in 10 minutes · Top 5 Excel Functions for Finance People (with end-to-end example)...
Read more >
Release Notes - Play services
December 15, 2022. The latest update to the Google Play services Matter library upgrades the APIs from beta status to generally available.
Read more >
Changelog | Meteor API Docs
Throwing an error when the login tokens are not generated well calling requestLoginTokenForUser. PR. Node updated to v14.19.3; npm update to v6.14.17; Fix ......
Read more >
1. ConfigObj 5 Introduction and Reference
ConfigObj - a Python module for easy reading and writing of config files. ... 1.4.1. Reading a Config File; 1.4.2. Writing a Config...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found