-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Compile issue with TypeScript and CommonJS with the shipped types for fast-xml-parser #724
Open
3 of 7 tasks
Comments
We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo. |
3 tasks
mpodwysocki
added a commit
to Azure/azure-sdk-for-js
that referenced
this issue
Feb 24, 2025
### Packages impacted by this PR - @azure/core-xml ### Issues associated with this PR - #33172 ### Describe the problem that is addressed by this PR Updates to latest `fast-xml-parser`, however, has issues with the types as noted in the PR in the `fast-xml-parser` repo NaturalIntelligence/fast-xml-parser#724 ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
amitguptagwl
added a commit
that referenced
this issue
Feb 25, 2025
Added the typings for CJS. Can you please check once? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When targeting both ESM and CommonJS for TypeScript, the CommonJS targeting will error with the following:
The issue is that you are shipping a single set of types for both ESM and CommonJS as noted here:
In this case you are shipping your ESM types,
./src/fxp.d.ts
for both ESM and CJS, which is a bug as noted on Are the Types Wrong? - fast-xml-parserThis gives helpful hints that this library is masquerading as ESM, and instead you should ship both a set of types for CommonJS and ESM such as the following:
Input
Upgrading the
@azure/core-xml
project to use the latestfast-xml-parser
as noted here: Azure/azure-sdk-for-js#33172 (comment)Code
This code will fail if we are using the targeting for CommonJS:
We can get rid of the overall compiler error with
@ts-ignore
but this is not idealOutput
expected data
Expected to compile, however does not unless using
@ts-ignore
.Would you like to work on this issue?
Bookmark this repository for further updates. Visit SoloThought to know about recent features.
The text was updated successfully, but these errors were encountered: