loopbackio / loopbackio/loopback-next

Error when running `npm run tsdocs`

Open
#10,205 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

### Describe the bug

Currently the release of loopback-next modules is blocked by the error when running the command `npm run tsdocs` as part of the release process.

Here is the error:
```
> @loopback/typeorm
Analysis will use the bundled TypeScript version 5.2.2
Error: Symbol not found for identifier: EventEmitter
at AstSymbolTable._analyzeChildTree (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:293:39)
at AstSymbolTable._analyzeChildTree (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/SOME_PATHloopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/SOME_PATHloopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeChildTree (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:377:18)
at AstSymbolTable._analyzeAstSymbol (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:247:18)
at AstSymbolTable.analyze (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/AstSymbolTable.js:113:25)
at /SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:247:62
at Map.forEach ()
at ExportAnalyzer._collectAllExportsRecursive (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:236:48)
at ExportAnalyzer._collectAllExportsRecursive (/SOME_PATH/loopback-next/node_modules/@microsoft/api-extractor/lib/analyzer/ExportAnalyzer.js:260:22)

```

I've tried a few things but still wasn't able to identify the problem:
1. force `showVerboseMessages` to be `true` in https://github.com/loopbackio/loopback-next/blob/master/packages/tsdocs/src/monorepo-api-extractor.ts#L258C5-L258C24 -> no effect
2. added `showDiagnostics: true,` before the line specified above -> it printed more info but it didn't mention where the error could be coming from.
3. When searching for similar errors, someone suggested (I lost the location where I saw that) to delete the folder `node_modules/@microsoft/api-extractor/node_modules/typescript`. But it didn't help either.

Since it's blocking the release of LB4 modules, we could possibly remove the api-extractor scripts. We would not have the latest API docs but at least we have the modules published while we're figuring this out.

@loopbackio/loopback-maintainers, thoughts?

### Logs

_No response_

### Additional information

_No response_

### Reproduction

https://github.com/loopbackio/loopback-next
- run `npm run tsdocs`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run `npm run tsdocs` in the loopback-next repository and reproduce the failure in `@loopback/typeorm`. Start by reading `packages/tsdocs/src/monorepo-api-extractor.ts`, especially the configuration around the referenced line, and investigate the `EventEmitter` symbol error from API Extractor. Done means the command completes successfully and API documentation can be generated for the release.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system, documentation, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.