Thanks to visit codestin.com
Credit goes to github.com

Skip to content

import { AppModule } from './app/app.module'; #13888

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
ghost opened this issue Mar 12, 2019 · 2 comments
Closed

import { AppModule } from './app/app.module'; #13888

ghost opened this issue Mar 12, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 12, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [x] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No

Description

By changing AppModule import url in main.ts ng add @angular/pwa or ng add @angular/material stop working because getAppModulePath from ng-ast-utils.ts combine ${mainDir} from angular.json and ${moduleRelativePath} from main.ts

image

🔬 Minimal Reproduction

Edit tsconfig.json

image

Change the AppModule import url

image

Run ng add @angular/pwa or ng add @angular/material

🔥 Exception or Error

Could not read file (/src/@app/app.module.ts).

🌍 Your Environment

Angular CLI: 7.3.5
Node: 10.15.1
OS: win32 x64
Angular: 7.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.5
@angular-devkit/build-angular     0.13.5
@angular-devkit/build-optimizer   0.13.5
@angular-devkit/build-webpack     0.13.5
@angular-devkit/core              7.3.5
@angular-devkit/schematics        7.3.5
@angular/cdk                      7.3.3
@angular/cli                      7.3.5
@angular/fire                     5.1.1
@angular/flex-layout              7.0.0-beta.23
@angular/material                 7.3.3
@angular/pwa                      0.12.4
@ngtools/webpack                  7.3.5
@schematics/angular               7.3.5
@schematics/update                0.13.5
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0

🔬Resolution

isRelativePath function should be added to determine whether the path to AppModule from main.ts is relative or not

@ghost ghost changed the title import { AppModule } from '@app/app.module'; import { AppModule } from './app/app.module'; Mar 12, 2019
@alan-agius4
Copy link
Collaborator

Duplicate of #12740

@alan-agius4 alan-agius4 marked this as a duplicate of #12740 Mar 12, 2019
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant