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

Assertion failed checking if declaration is parameter #1443

Closed
benmccann opened this issue Jan 1, 2021 · 6 comments
Closed

Assertion failed checking if declaration is parameter #1443

benmccann opened this issue Jan 1, 2021 · 6 comments
Labels
bug Functionality does not match expectation

Comments

@benmccann
Copy link

Search terms

TypeDoc exiting with unexpected error:
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

Expected Behavior

Expected docs to generate without error

Actual Behavior

$ npx typedoc 
TypeDoc exiting with unexpected error:
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert(declaration &&
      (ts.isParameter(declaration) ||
          ts.isJSDocParameterTag(declaration)))

    at /node_modules/typedoc/dist/lib/converter/factories/signature.js:40:9
    at Array.map (<anonymous>)
    at convertParameters (/home/bmccann/src/Chart.js/node_modules/typedoc/dist/lib/converter/factories/signature.js:38:23)
    at Object.createSignature (/home/bmccann/src/Chart.js/node_modules/typedoc/dist/lib/converter/factories/signature.js:24:25)
    at Object.convertFunctionOrMethod (/home/bmccann/src/Chart.js/node_modules/typedoc/dist/lib/converter/symbols.js:162:39)
    at convertSymbol (/home/bmccann/src/Chart.js/node_modules/typedoc/dist/lib/converter/symbols.js:76:79)
    at convertSymbols (/home/bmccann/src/Chart.js/node_modules/typedoc/dist/lib/converter/symbols.js:82:9)
    at Object.convertClassOrInterface (/home/bmccann/src/Chart.js/node_modules/typedoc/dist/lib/converter/symbols.js:205:5)
    at convertSymbol (/home/bmccann/src/Chart.js/node_modules/typedoc/dist/lib/converter/symbols.js:76:79)
    at Object.convertAlias (/home/bmccann/src/Chart.js/node_modules/typedoc/dist/lib/converter/symbols.js:365:9) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: true,
  operator: '=='
}

Steps to reproduce the bug

git clone https://github.com/benmccann/Chart.js
cd Chart.js
git checkout typedoc-upgrade
npm install
npx typedoc

Environment

  • Typedoc version: 0.20.7
  • TypeScript version: 4.1.3
  • Node.js version: 14.8.0
  • OS: Ubuntu
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 1, 2021

Well, that's annoying... arguments is the issue here. TS knows there is a rest parameter, but there is no declaration for it.

	/**
	 * @private
	 */
	_onDataPush() {
		const count = arguments.length;
		this._insertElements(this.getDataset().data.length - count, count);
	}

@Gerrit0 Gerrit0 closed this as completed in 1886304 Jan 2, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 2, 2021

Fixed in 0.20.9, plus another bug that this revealed

@benmccann
Copy link
Author

Wow, amazing! Thanks for the super fast look at this!! 😃

@benmccann
Copy link
Author

It looks like publishing 0.20.9 might have failed. It's not available and I see a red X here: https://github.com/TypeStrong/typedoc/runs/1635049281

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 2, 2021

Shoot, sorry about that. I was rushing to push the change and go to a friend's, so didn't properly test things. Published now!

@benmccann
Copy link
Author

awesome. thanks! It looks like 0.20 is working on Chart.js now, so I just sent a PR to upgrade it 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants