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

[BUG] Cannot parse import .html files #1121

Closed
joefiorini opened this issue Sep 3, 2021 · 0 comments
Closed

[BUG] Cannot parse import .html files #1121

joefiorini opened this issue Sep 3, 2021 · 0 comments
Assignees
Milestone

Comments

@joefiorini
Copy link

Overview of the issue

This is the same problem as in #921, #317, #1018, #637, namely, all of our components directly import html templates as strings rather than using the templateUrl property (we are NOT using angular-cli). A failing component looks like the following:

example.component.ts

import { Input, Component } from '@angular/core'

import template from './example.component.html'

@Component({
  selector: 'example',
  template,
})
export class ExampleComponent {
}
Unhandled Rejection at: Promise {
  <rejected> TypeError: Cannot read property 'kind' of undefined
      at Object.isArrayLiteralExpression (/home/joe/src/sandbox/compodoc-reproduction/node_modules/@ts-morph/common/dist/typescript.js:27423:21)
      at SymbolHelper.parseSymbols (/home/joe/src/sandbox/compodoc-reproduction/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:7792:24)
      at /home/joe/src/sandbox/compodoc-reproduction/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:7827:62
      at Array.map (<anonymous>)
      at SymbolHelper.getSymbolDeps (/home/joe/src/sandbox/compodoc-reproduction/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:7827:30)
      at ComponentHelper.getComponentTemplate (/home/joe/src/sandbox/compodoc-reproduction/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:7866:35)
      at ComponentDepFactory.create (/home/joe/src/sandbox/compodoc-reproduction/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:8269:35)
      at visitDecorator (/home/joe/src/sandbox/compodoc-reproduction/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:8820:95)
      at Array.forEach (<anonymous>)
      at parseNode (/home/joe/src/sandbox/compodoc-reproduction/node_modules/@compodoc/compodoc/dist/index-cli-32a621dc.js:8938:64)
Operating System, Node.js, npm, compodoc version(s)

1.1.14

Angular configuration, a package.json file in the root folder
Compodoc installed globally or locally ?

locally

If possible sourcecode of the file where it breaks

Here's a repo where I've reproduced the problem:

https://github.com/joefiorini/compodoc-repro-example

Setup following the documentation exactly...

If possible your terminal logs before the error
Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
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