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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regression] - PR #1148 now wrongly resolves paths #1170

Closed
freed00m opened this issue Jan 5, 2022 · 0 comments
Closed

[Regression] - PR #1148 now wrongly resolves paths #1170

freed00m opened this issue Jan 5, 2022 · 0 comments
Assignees
Milestone

Comments

@freed00m
Copy link

freed00m commented Jan 5, 2022

Overview of the issue

Hi, I think this change #1148 cause me some weird issue.

I am having

import { demoRoutes } from './app-routing.module.dummy'

now it failing because it searching for file named

"app-routing.ts" and should look for "app-routing.module.dummy.ts"

[13:56:52] parsing        : /home/z003zvsd/src/s7p-webserver-ui/src/app/app-routing.module.dummy.ts
[13:56:52] found          : demoRoutes
[13:56:52] parsing        : /home/z003zvsd/src/s7p-webserver-ui/src/app/app-routing.module.ts
[13:56:52] Analysing routes definitions and clean them if necessary
Unhandled Rejection at: Promise {
  <rejected> FileNotFoundError: File not found: /home/z003zvsd/src/s7p-webserver-ui/src/app/app-routing.ts
      at DirectoryCoordinator.addSourceFileAtPath (/home/z003zvsd/src/s7p-webserver-ui/node_modules/ts-morph/dist/ts-morph.js:18641:19)
      at Project.addSourceFileAtPath (/home/z003zvsd/src/s7p-webserver-ui/node_modules/ts-morph/dist/ts-morph.js:20086:51)
      at _loop_3 (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:6397:33)
      at RouterParserUtil.cleanFileSpreads (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:6427:17)
      at AngularDependencies.getSourceFileDecorators (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:9320:32)
      at /home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:9130:31
      at Array.map (<anonymous>)
      at AngularDependencies.getDependencies (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:9119:21)
      at CliApplication.Application.getDependenciesData (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:10845:40)
      at /home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:10656:23 {
    path: '/home/z003zvsd/src/s7p-webserver-ui/src/app/app-routing.ts',
    code: 'ENOENT'
  }
} reason: FileNotFoundError: File not found: /home/z003zvsd/src/s7p-webserver-ui/src/app/app-routing.ts
    at DirectoryCoordinator.addSourceFileAtPath (/home/z003zvsd/src/s7p-webserver-ui/node_modules/ts-morph/dist/ts-morph.js:18641:19)
    at Project.addSourceFileAtPath (/home/z003zvsd/src/s7p-webserver-ui/node_modules/ts-morph/dist/ts-morph.js:20086:51)
    at _loop_3 (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:6397:33)
    at RouterParserUtil.cleanFileSpreads (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:6427:17)
    at AngularDependencies.getSourceFileDecorators (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:9320:32)
    at /home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:9130:31
    at Array.map (<anonymous>)
    at AngularDependencies.getDependencies (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:9119:21)
    at CliApplication.Application.getDependenciesData (/home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:10845:40)
    at /home/z003zvsd/src/s7p-webserver-ui/node_modules/@compodoc/compodoc/dist/index-cli-298ea115.js:10656:23 {
  path: '/home/z003zvsd/src/s7p-webserver-ui/src/app/app-routing.ts',
  code: 'ENOENT'
}

currently workaroundable by having a symlink

 $ cd src/app
 $ ln -s app-routing.module.dummy.ts app-routing.ts
Operating System, Node.js, npm, compodoc version(s)

OS is Archlinux stable, nodejs stable, npm+yarn-berry stable

and after upgrading compodoc 1.1.15 -> 1.1.16

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

Probably have more dots in the file name of the router file

Suggest a Fix

Maybe ts-morph has wrong implementation of getModuleSpecifierValue() and should this be filed as upstream bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants