René's URL Explorer Experiment


Title: ng add fails to find app.module.ts when using custom tsconfig.json paths · Issue #12740 · angular/angular-cli · GitHub

Open Graph Title: ng add fails to find app.module.ts when using custom tsconfig.json paths · Issue #12740 · angular/angular-cli

X Title: ng add fails to find app.module.ts when using custom tsconfig.json paths · Issue #12740 · angular/angular-cli

Description: Bug Report or Feature Request (mark with an x) - [X ] bug report -> please search issues before submitting - [X ] feature request Whether this is a bug or a feature depends on whether or not custom paths in tsconfig.json are supported wi...

Open Graph Description: Bug Report or Feature Request (mark with an x) - [X ] bug report -> please search issues before submitting - [X ] feature request Whether this is a bug or a feature depends on whether or not custom...

X Description: Bug Report or Feature Request (mark with an x) - [X ] bug report -> please search issues before submitting - [X ] feature request Whether this is a bug or a feature depends on whether or not cus...

Opengraph URL: https://github.com/angular/angular-cli/issues/12740

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ng add fails to find app.module.ts when using custom tsconfig.json paths","articleBody":"### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [X ] bug report -\u003e please search issues before submitting\r\n- [X ] feature request\r\n```\r\nWhether this is a bug or a feature depends on whether or not custom `paths` in `tsconfig.json` are supported with the Cli.\r\n\r\n### Command (mark with an `x`)\r\n```\r\n- [X ] add\r\n```\r\n\r\n### Versions\r\nAngular CLI: 7.0.2                                          \r\nNode: 10.8.0                                                \r\nOS: win32 x64                                               \r\nAngular: 7.0.0                                              \r\n... animations, common, compiler, compiler-cli, core, forms \r\n... http, language-service, platform-browser                \r\n... platform-browser-dynamic, router                        \r\n\r\n### Repro steps\r\n- `ng new app-name` (pick defaults)\r\n- Add `\"paths\": { \"@app/*\": [\"src/app/*\"] }` to `tsconfig.json`\r\n- Update `main.ts` to use this new path\r\n    `import { AppModule } from '@app/app.module';`\r\n    `import { environment } from './environments/environment';`\r\n- `ng add @angular/material`\r\n- Select `Yes` for `? Set up browser animations for Angular Material?`\r\n\r\nRepository all set up to reproduce this error is available [here](https://github.com/seangwright/ng-cli-add-error-with-tsconfig-paths).\r\nJust clone and type `ng add @angular/material`.\r\n\r\n### The log given by the failure\r\n`Could not read Angular module file: /src/@app/app.module.ts`\r\n\r\n### Desired functionality\r\nCli handles custom paths in `tsconfig.json`.\r\n\r\n### Mention any other details that might be useful\r\nHere is where material tries to get the `app.module.ts` path\r\nhttps://github.com/angular/material2/blob/985774a4eaa14d1dcbf1ad96ab176043d38f433e/src/lib/schematics/ng-add/setup-project.ts#L56\r\n\r\nHere is where the path to `app.module.ts` is being calculated in the schematics code\r\nhttps://github.com/angular/angular-cli/blob/82f2bda2f59e4665611d1a75b51a62bae21ac340/packages/schematics/angular/utility/ng-ast-utils.ts#L78\r\n\r\nI believe the above link is what is causing the problem.\r\n\r\nI've always preferred absolute urls in Angular apps compared to the relative paths (which become very difficult to read for nested components).\r\n\r\nAdding custom `paths` to `tsconfig.json` works pretty well to solve this problem. VSCode works fine with it and the Cli has no other issues I've run into.\r\n\r\nIf using `paths` isn't officially supported does the Angular team recommend using relative paths like `import { MyApiService } from '../../../../../my-api.service'`?\r\n","author":{"url":"https://github.com/seangwright","@type":"Person","name":"seangwright"},"datePublished":"2018-10-24T20:21:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/12740/angular-cli/issues/12740"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7e0c17e4-281f-3d63-5dd8-dce081776734
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id85BC:3A1ACB:58ECDD:799B16:6964F557
html-safe-nonce3fc8a533048106706c59560bb74fa3502ad03836dd095022c736e2773250aea0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUJDOjNBMUFDQjo1OEVDREQ6Nzk5QjE2OjY5NjRGNTU3IiwidmlzaXRvcl9pZCI6IjMyNTA2NzQ3MzczNzIwMDE2MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8452b11b1cef071a2eee8ce38b0a5414efa2704cd86e34308f1c915fe3d7dee7
hovercard-subject-tagissue:373661172
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/12740/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9301cfef23a3b2589b748e6b8fd04830caf953d10537eeffd8dd28e3c3064f07/angular/angular-cli/issues/12740
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9301cfef23a3b2589b748e6b8fd04830caf953d10537eeffd8dd28e3c3064f07/angular/angular-cli/issues/12740
og:image:altBug Report or Feature Request (mark with an x) - [X ] bug report -> please search issues before submitting - [X ] feature request Whether this is a bug or a feature depends on whether or not custom...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameseangwright
hostnamegithub.com
expected-hostnamegithub.com
None003e962bf5ca78f3f8f71db2461c6a7f9cfcbe99b480d6aeddaef78d33e9161a
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release21cbf6733480c5c09366f15b8dc8b6953472172a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/12740#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F12740
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F12740
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/12740
Reloadhttps://github.com/angular/angular-cli/issues/12740
Reloadhttps://github.com/angular/angular-cli/issues/12740
angular https://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Notifications https://github.com/login?return_to=%2Fangular%2Fangular-cli
Fork 11.9k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Star 27k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Code https://github.com/angular/angular-cli
Issues 264 https://github.com/angular/angular-cli/issues
Pull requests 22 https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/angular/angular-cli/security
Please reload this pagehttps://github.com/angular/angular-cli/issues/12740
Insights https://github.com/angular/angular-cli/pulse
Code https://github.com/angular/angular-cli
Issues https://github.com/angular/angular-cli/issues
Pull requests https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/12740
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/12740
Bughttps://github.com/angular/angular-cli/issues?q=type:"Bug"
ng add fails to find app.module.ts when using custom tsconfig.json pathshttps://github.com/angular/angular-cli/issues/12740#top
area: @schematics/angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40schematics%2Fangular%22
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular-cli/milestone/12
https://github.com/seangwright
https://github.com/seangwright
seangwrighthttps://github.com/seangwright
on Oct 24, 2018https://github.com/angular/angular-cli/issues/12740#issue-373661172
herehttps://github.com/seangwright/ng-cli-add-error-with-tsconfig-paths
https://github.com/angular/material2/blob/985774a4eaa14d1dcbf1ad96ab176043d38f433e/src/lib/schematics/ng-add/setup-project.ts#L56https://github.com/angular/material2/blob/985774a4eaa14d1dcbf1ad96ab176043d38f433e/src/lib/schematics/ng-add/setup-project.ts#L56
angular-cli/packages/schematics/angular/utility/ng-ast-utils.tshttps://github.com/angular/angular-cli/blob/82f2bda2f59e4665611d1a75b51a62bae21ac340/packages/schematics/angular/utility/ng-ast-utils.ts#L78
82f2bdahttps://github.com/angular/angular-cli/commit/82f2bda2f59e4665611d1a75b51a62bae21ac340
area: @schematics/angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40schematics%2Fangular%22
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Bughttps://github.com/angular/angular-cli/issues?q=type:"Bug"
BacklogNo due datehttps://github.com/angular/angular-cli/milestone/12
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.