Skip to content

[core-xml] Fix build failure #27196

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

Closed
wants to merge 1 commit into from

Conversation

HarshaNalluru
Copy link
Member

@HarshaNalluru HarshaNalluru commented Sep 21, 2023

Packages impacted by this PR

@azure/core-xml

Issues associated with this PR

#27195


==[ BLOCKED: 4 operations ]====================================================

These operations were blocked by dependencies that failed:
  @azure/event-hubs
  @azure/test-utils
  @azure-tools/test-recorder
  @azure/core-client

==[ FAILURE: 1 operation ]=====================================================

--[ FAILURE: @azure/core-xml ]-------------------------------[ 2.09 seconds ]--

Invoking: npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local && npm run build:types 

> @azure/[email protected] clean
> rimraf dist dist-* temp types *.tgz *.log

src/xml.ts(102,7): error TS7053: Element implicitly has an 'any' type because expression of type '"?xml"' can't be used to index type 'GenericObjectOrArray<unknown>'.
  Property '?xml' does not exist on type 'GenericObjectOrArray<unknown>'.
src/xml.ts(103,12): error TS7053: Element implicitly has an 'any' type because expression of type '"?xml"' can't be used to index type 'GenericObjectOrArray<unknown>'.
  Property '?xml' does not exist on type 'GenericObjectOrArray<unknown>'.
src/xml.ts(108,21): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'GenericObjectOrArray<unknown>'.
  No index signature with a parameter of type 'string' was found on type 'GenericObjectOrArray<unknown>'.


Operations failed.

rush build (2.46 seconds)

Spotted while working on #26748

Describe the problem that is addressed by this PR

Uses type guards to narrow down the type of parsedXml

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@@ -99,14 +100,17 @@ export async function parseXML(str: string, opts: XmlOptions = {}): Promise<any>

// Remove the <?xml version="..." ?> node.
// This is a change in behavior on fxp v4. Issue #424
if (parsedXml["?xml"]) {
if (objectHasProperty(parsedXml, "?xml")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but this seems like a big hammer for this fix, could we just instantiate the type variable in the method call in L99 with Record<string, any>?

@jeremymeng
Copy link
Member

something wrong with pnpm-lock.yaml so rush update is bumping dependency versions. New fast-xml-parser version is breaking NaturalIntelligence/fast-xml-parser#612

I will fix the lock file. let's wait to see if fast-xml-parser can fix it.

@HarshaNalluru
Copy link
Member Author

let's wait to see if fast-xml-parser can fix it.

should I close this PR?

@jeremymeng
Copy link
Member

should I close this PR?

you can leave it and address Deyaa's feedback in case we don't get a fix soon. Our weekly rush full update automation will fail I suppose.

Copy link

Hi @HarshaNalluru. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Nov 24, 2023
Copy link

github-actions bot commented Dec 1, 2023

Hi @HarshaNalluru. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing /reopen if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the no-recent-activity label; otherwise, this is likely to be closed again with the next cleanup pass.

@github-actions github-actions bot closed this Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core no-recent-activity There has been no recent activity on this issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants