Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom path in tsconfig for multiple project stop work as should after upgrade to Angular 9 #17338

Closed
ofirrifo opened this issue Mar 30, 2020 · 9 comments
Labels
needs: repro steps We cannot reproduce the issue with the information given

Comments

@ofirrifo
Copy link

馃悶 bug report

Is this a regression?

With Angular 8 it work as should
Now after I upgrade it not work

Description

I'm using angular cli with multiple project.
After I follow the Angular Update Guide I start to get ts2307 cannot find module '@app....'

My tsconfig.json (projects/portal/tsconfig.app.json)

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "baseUrl": "src",
    "outDir": "../../out-tsc/app",
    "types": [],
    "paths": {
      "@app/*": [
        "app/*"
      ],
      "@env/*": [
        "environments/*"
      ],
      "@sol/*": [
        "../../shared-lib/src/lib/*"
      ]
    }
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "projects/admin-portal/src/**/*.d.ts"
  ]
}

It used to work before the upgrade.
Please let me know how to handle it.
Thanks :)

馃敟 Exception or Error


For all the imports that I'm using with shortened path prefix '@app/...'
Im geting this error:
ts2307 cannot find module '@app....'

馃實 Your Environment

Angular Version:



Angular CLI: 9.1.0
Node: 12.3.1
OS: darwin x64

Angular: 9.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.0
@angular-devkit/build-angular     0.901.0
@angular-devkit/build-optimizer   0.901.0
@angular-devkit/build-webpack     0.901.0
@angular-devkit/core              9.1.0
@angular-devkit/schematics        9.1.0
@angular-devkit/schematics-cli    0.803.25
@angular/cdk                      9.2.0
@angular/material                 9.2.0
@ngtools/webpack                  9.1.0
@nguniversal/express-engine       8.2.6
@schematics/angular               9.1.0
@schematics/schematics            0.803.25
@schematics/update                0.901.0
rxjs                              6.5.4
typescript                        3.8.3
webpack                           4.42.0


@petebacondarwin
Copy link
Member

Transferring to the CLI project...

@petebacondarwin petebacondarwin transferred this issue from angular/angular Mar 30, 2020
@alan-agius4
Copy link
Collaborator

@ofirrifo, can you try to update your baseUrl from src to ./src?

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Mar 30, 2020
@ofirrifo
Copy link
Author

I did set ./src but still the error display.
Is there additional things I can share with you so we can solve that issue ?
be aware that I can't share this project as it private.

Thanks

@alan-agius4
Copy link
Collaborator

Can you setup a minimal repro please? A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

@alan-agius4 alan-agius4 added needs: repro steps We cannot reproduce the issue with the information given and removed needs: more info Reporter must clarify the issue labels Mar 30, 2020
@alan-agius4
Copy link
Collaborator

@ofirrifo, you are seeing the error during built or in the IDE?, As if the latter, it is expected since for the IDE to pick up the paths settings they need to be in a file named tsconfig.json. which is related to #8138

@ofirrifo
Copy link
Author

@alan-agius4 only in the ide

@alan-agius4
Copy link
Collaborator

In that case let's continue tracking this in #8138.

As a workaround you can copy projects/portal/tsconfig.app.json and name it projects/portal/tsconfig.json.

@ofirrifo
Copy link
Author

@alan-agius4 replacing the tsconfig.app.json to tsconfig.json
WORK :)

I will need to revert this change after it will be fixed?

@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 May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

No branches or pull requests

3 participants