Skip to content

[BUG] File Not Found - Error -> @-path from tsconfig.json not working #654

Closed

Description

@nickwinger
Overview of the issue

Generation breaks:

Unhandled Rejection at: Promise { <rejected> { Error: File not found: C:/Dev/KPD2.0/src/app/stage/@app/stage/apps/apps-routing.module.ts

the @-path is just appended and not correctly resolved from the ts-config.json file
This is the line in Typescript that breaks:
import {appsRoutes} from '@app/stage/apps/apps-routing.module';

(the file of this line is inside C:/Dev/KPD2.0/src/app/stage)

Operating System, Node.js, npm, compodoc version(s)

Node: 8.11.1
OS: win32 x64 (Windows 10)
npm 6.0.1
CompoDoc: 1.1.5

Angular configuration, a package.json file in the root folder

tsconfig:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"paths": {
"@test/": ["test/"],
"@app/": ["app/"],
"@env/": ["environments/"]
},
"lib": [
"es2016",
"dom"
],
"plugins": [
{"name": "@angular/language-service"}
]
}
}

Compodoc installed globally or locally ?

locally

If possible sourcecode of the file where it breaks

import {appsRoutes} from '@app/stage/apps/apps-routing.module';

If possible your terminal logs before the error

`Unhandled

Rejection at: Promise {
{ Error: File not found: C:/Dev/KPD2.0/src/app/stage/@app/stage/apps/apps-routing.module.ts
at FileNotFoundError.BaseError [as constructor] (C:\Dev\KPD2.0\node_modules\ts-simple-ast\dist\errors\BaseError.js:7:28)
at new FileNotFoundError (C:\Dev\KPD2.0\node_modules\ts-simple-ast\dist\errors\FileNotFoundError.js:8:28)
at Project.addExistingSourceFile (C:\Dev\KPD2.0\node_modules\ts-simple-ast\dist\Project.js:188:19)
at _loop_3 (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:1309:33)
at RouterParserUtil.cleanFileSpreads (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:1337:13)
at AngularDependencies.getSourceFileDecorators (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:6304:48)
at C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:6118:31
at Array.map ()
at AngularDependencies.getDependencies (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:6106:21)
at CliApplication.Application.getDependenciesData (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:7971:40)
filePath: 'C:/Dev/KPD2.0/src/app/stage/@app/stage/apps/apps-routing.module.ts',
code: 'ENOENT' } } reason: { Error: File not found: C:/Dev/KPD2.0/src/app/stage/@app/stage/apps/apps-routing.module.ts
at FileNotFoundError.BaseError [as constructor] (C:\Dev\KPD2.0\node_modules\ts-simple-ast\dist\errors\BaseError.js:7:28)
at new FileNotFoundError (C:\Dev\KPD2.0\node_modules\ts-simple-ast\dist\errors\FileNotFoundError.js:8:28)
at Project.addExistingSourceFile (C:\Dev\KPD2.0\node_modules\ts-simple-ast\dist\Project.js:188:19)
at _loop_3 (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:1309:33)
at RouterParserUtil.cleanFileSpreads (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:1337:13)
at AngularDependencies.getSourceFileDecorators (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:6304:48)
at C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:6118:31
at Array.map ()
at AngularDependencies.getDependencies (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:6106:21)
at CliApplication.Application.getDependenciesData (C:\Dev\KPD2.0\node_modules@compodoc\compodoc\dist\index-cli.js:7971:40)
filePath: 'C:/Dev/KPD2.0/src/app/stage/@app/stage/apps/apps-routing.module.ts',
`

Motivation for or Use Case
Reproduce the error

Just use an @-path inside the Typescript sourcefile

Related issues
Suggest a Fix

build the @-path correctly by replacing it with the info from tsconfig.json
instead of appending it to the source-file current path

Activity

  1. added this to the 1.1.7 milestone on Oct 10, 2018
  2. changed the title [-]File Not Found - Error -> @-path from tsconfig.json not working[/-] [+][BUG] File Not Found - Error -> @-path from tsconfig.json not working[/+] on Oct 10, 2018
  3. modified the milestones: 1.1.7, 1.1.9 on Jan 29, 2019
  4. modified the milestones: 1.1.9, 1.3.0 on Feb 23, 2019
  5. stale commented on Sep 30, 2019

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  6. stale commented on Oct 7, 2019

    @stale

    This issue has been automatically closed because it has not had recent activity. Please file a new issue if you are encountering a similar or related problem. Thank you for your contributions.

  7. ReyOrtiz commented on Nov 8, 2019

    @ReyOrtiz

    The issue is still present in 1.1.11 version. Can it be reopened please?

  8. lock commented on Jan 7, 2020

    @lock

    This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

  9. locked as resolved and limited conversation to collaborators on Jan 7, 2020
  10. modified the milestones: 1.3.0, 1.2.0 on Jul 15, 2021
  11. added a commit that references this issue on May 24, 2026
    07dbf7a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions