question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build error when a method has documentation with annotations above it ie. @param

See original GitHub issue

Type of Issue

Build error

[X] Bug Report
[ ] Feature Request

Description

Adding doc with method signature annotations causing packager to error.

LIKE BUILD ERROR src/app/common/featureflags.service.ts(59,3): warning TS0: the type annotation on @param is redundant with its TypeScript

Example service method

/**

  • Returns the service label for a given service
  • Returns the id , if the service is not available
  • @param {string} id
  • @returns {string} */ public getServiceLabel(id: string): string { if(this.SERVICE_REGISTRY[id]) { return this.SERVICE_REGISTRY[id].label; } else { return id; } }

How To Reproduce

Steps 1 - Add a documentation to one of your service Like the one above start with / * * and add @param End your documentation

2 - Run ng-packagr -p ng-package.json

Can you reproduce the error in the integration tests in ng-packagr? If possible, take a look at the integration/samples and try to break one of >>these builds!

Is the error you faced in an application importing the library Try to break the Angular CLI app in integration/consumers/ng-cli!

Expected Behaviour

A bug: please describe what behavior or result you expected Build without erroring out.

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr: 5.6.0
@angular/*: 5.2.10
typescript: ~2.6.2
"rxjs": "^5.5.11",
node: v8.11.1
npm: 5.6.0

Please include all version numbers that might be relevant, e.g. third-party libraries

Thanks and regards,

Aykut~

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Aphaxcommented, Jul 10, 2018

Having the same troubles. Removing @ annotation sign juste makes jsdoc not interpreted, how comes ng build isn’t affected by those annotations but ng-packagr does ? I don’t see why this error should be an expected behavior since ng build does not fail.

0reactions
github-actions[bot]commented, Jun 19, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

build error when a method has documentation with ... - GitHub
The main issue seems to be identifyin documentation 'context'. When building/ compiling if you are in the documentation context, or could ...
Read more >
How to Write Doc Comments for the Javadoc Tool - Oracle
A doc comment is written in HTML and must precede a class, field, constructor or method declaration. It is made up of two...
Read more >
Code annotation attributes | ReSharper Documentation
This annotation is used for paramerers like 'string paramName' parameter of the System. ArgumentNullException constuctor.
Read more >
Error when trying to inject a service into an angular ...
The error I get in the browser console is this: EXCEPTION: Can't resolve all parameters for HeaderComponent: (?). I have the service in...
Read more >
Documentation comments - C# language specification
3.9 <param>. This tag is used to describe a parameter for a method, constructor, or indexer. Syntax: <param name=" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found