aws / aws/jsii

xmldom fatalError

Open
#4,645 3 comments 0 reactions 0 assignees View on GitHub
bug p2
Dominant language
TypeScript
Stars
2.9k
Forks
267
Avg merge
1d 25m
Merged PRs (30d)
14

Description

### Describe the bug

During a dotnet target build, the message:

> [xmldom fatalError] Opening and ending tag mismatch: "function" != "jsii-root"
> @#[line:1,col:22]

repeats itself three times.

_This doesn't seem to be a fatal error, but the message is declaring something is wrong with parsing a document_

### Expected Behavior

No fatal error or warning messages, or location of the error.

### Current Behavior

On building the dotnet target, there are messages, even sending `--verbose --verbose --verbose` has no more information on the messages.

### Reproduction Steps

I've tried to make an SSCCE, but cannot reproduce, however this repository reproduces the issue. I've run `npx jsii-pacmak --verbose --verbose --verbose --no-clean --target dotnet` and searched for missing XML tags and `jsii-root` without results.

prerequisites: `git`, `node`, and `yarn`

1. `git clone https://github.com/awslabs/generative-ai-cdk-constructs.git`
2. `cd generative-ai-cdk-constructs.git`
3. `npx projen install`
4. `npx projen`
5. `npx projen compile`
6. `npx projen package:dotnet`

```
👾 package:dotnet | jsii-pacmak -v --target dotnet
[jsii-pacmak] [INFO] Found 1 modules to package
[jsii-pacmak] [INFO] Packaging NPM bundles
[jsii-pacmak] [INFO] Loading jsii assemblies and translations
[jsii-pacmak] [INFO] Packaging 'dotnet' for @cdklabs/generative-ai-cdk-constructs
[xmldom fatalError] Opening and ending tag mismatch: "function" != "jsii-root"
@#[line:1,col:22]
[xmldom fatalError] Opening and ending tag mismatch: "function" != "jsii-root"
@#[line:1,col:22]
[xmldom fatalError] Opening and ending tag mismatch: "function" != "jsii-root"
@#[line:1,col:22]
[jsii-pacmak] [INFO] dotnet finished
[jsii-pacmak] [INFO] Packaged. dotnet (2.6s) | npm pack (1.3s) | load jsii (0.7s) | cleanup (???)
```

### Possible Solution

Searching for `jsii-root` or `function` revealed nothing...

Found the https://github.com/aws/jsii-rosetta/ project through https://github.com/search?q=jsii-root&type=code, which pointed to the sax parser within the @xmldom/xmldom matching the fatal message.

### Additional Information/Context

I believe some HTML document causing this, but cannot find where that might be:

jsii-rosettta:
https://github.com/aws/jsii-rosetta/blob/22f6add087c99fc9626cc953ab7335c196979460/src/markdown/xml-comment-renderer.ts#L79

@xmldom/xmldom:
https://github.com/xmldom/xmldom/blob/8d576bee7d2121d62f78db1d3b064adfe42a0a0e/lib/sax.js#L168

### SDK version used

jsii-pacmak --version 1.103.1 (build bef2dea) dotnet --version 9.0.100-rc.1.24452.12

### Environment details (OS name and version, etc.)

macOS

Contributor guide

Open the contributing guide

Research direction

Start by running the listed jsii-pacmak dotnet reproduction in the generative-ai-cdk-constructs repository and compare the behavior with the reported versions. Then inspect jsii-rosetta's src/markdown/xml-comment-renderer.ts and @xmldom/xmldom's lib/sax.js, which the issue identifies as the relevant parsing path. Done means identifying the source of the repeated diagnostics and establishing where the error should be handled or reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.