GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ng add @angular/material cannot find AppModule if imported through index.ts · Issue #12729 · angular/angular-cli

ng add @angular/material cannot find AppModule if imported through index.ts  #12729

New issue
Copy link
New issue
Copy link
Closed
Closed
ng add @angular/material cannot find AppModule if imported through index.ts #12729
Copy link
Labels
area: @schematics/angularfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Milestone
Backlog

Description

@ajaypbarokar
ajaypbarokar
opened on Oct 24, 2018
Issue body actions

Bug Report or Feature Request (mark with an x)

  • bug report -> please search issues before submitting
  • feature request

Area

  • devkit
  • schematics

Versions
node --version
v10.10.0
npm --version
6.4.1

ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 7.0.2
Node: 10.10.0
OS: win32 x64
Angular: 7.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.10.2
@angular-devkit/build-angular     0.10.2
@angular-devkit/build-optimizer   0.10.2
@angular-devkit/build-webpack     0.10.2
@angular-devkit/core              7.0.2
@angular-devkit/schematics        7.0.2
@angular/cdk                      7.0.1
@angular/cli                      7.0.2
@angular/material                 7.0.1
@ngtools/webpack                  7.0.2
@schematics/angular               7.0.2
@schematics/update                0.10.2
rxjs                              6.3.3
typescript                        3.1.3
webpack                           4.19.1

Repro steps

Create an Angular 7 application
If not present, create a index.ts in the App module folder with at least the following content:

export * from './app.module';

In the main.ts, import the App module indirectly by using its parent folder:

import './polyfills.ts';import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app';
import { environment } from './environments/environment';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .catch(err => console.error(err));

Now use angular CLI to add material

 ng add @angular/material 

The log given by the failure :

ng add @angular/material
Installing packages for tooling via npm.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @angular/[email protected]
added 1 package and audited 39127 packages in 31.058s
found 0 vulnerabilities

Installed packages for tooling via npm.
? Enter a prebuilt theme name, or "custom" for a custom theme: custom
? Set up HammerJS for gesture recognition? No
? Set up browser animations for Angular Material? Yes
UPDATE package.json (1376 bytes)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 2 packages from 1 contributor and audited 39130 packages in 23.409s
found 0 vulnerabilities

Could not read Angular module file: /src/app.ts
Reacted by Lung314 and Qualwebs

Activity

  1. alan-agius4
    added
    freq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarely
    severity3: broken
    area: @schematics/angular
    on Oct 24, 2018
  2. ngbot
    added this to the needsTriage milestone on Oct 24, 2018
  3. alan-agius4
    added
    type: bug/fix
    on Oct 24, 2018
  4. ngbot
    modified the milestones: needsTriage, Backlog on Oct 24, 2018
  5. clydin commented on Sep 19, 2019

    @clydin
    clydin
    on Sep 19, 2019
    Member
    More actions

    The logic for adding @angular/material is contained within the @angular/material package itself and is managed at its repository. If the problem still persists when using the latest version of @angular/material (currently 8.2.0), please open an issue report at its repository.

  6. clydin
    closed this as completedon Sep 19, 2019
  7. angular-automatic-lock-bot commented on Oct 20, 2019

    @angular-automatic-lock-bot
    angular-automatic-lock-botBot
    on Oct 20, 2019
    More actions

    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.

  8. angular-automatic-lock-bot
    locked and limited conversation to collaborators on Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @schematics/angularfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      • BacklogNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.