Skip to content
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

Class 'XMLBuilderCBImpl' incorrectly implements interface 'XMLBuilderCB' #52

Closed
nlsnightmare opened this issue Aug 28, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@nlsnightmare
Copy link

Describe the bug
When i try to compile my code using tsc i get the following compile error. When i run the code with ts-node, it runs fine.

To Reproduce
Use the xml builder

Expected behavior
The code compiles

Version:

  • typescript 3.3.3333
  • xmlbuilder2 2.3.1
@nlsnightmare nlsnightmare added the bug Something isn't working label Aug 28, 2020
@oozcitak
Copy link
Owner

I can't reproduce this. Can you post your code?

@nlsnightmare
Copy link
Author

I created a new project, just to make a sanity check. I followed the following steps:

mkdir xmlbuilder2-test && cd $_
mkdir src
tsc --init
npm init -y
npm install xmlbuilder2

After that, i added the following code to src/index.ts:

import { create } from "xmlbuilder2";
import { XMLBuilder } from "xmlbuilder2/lib/interfaces";
function main() {
    const builder: XMLBuilder = create()
        .ele('some-element');

    console.log('i created the xml', builder.end({ prettyPrint: true }))
}

main()

After that, I run tsc in the project root, and... it worked! So I did some digging. Turns out, the tsconfig.json which was autogenerated containg the flag skipLibCheck: true on by default. When I added the flag to my original project, it compiled!

My problem is practically solved, however I'll leave the issue open in case you want to dig deeper.

@oozcitak
Copy link
Owner

Thank you for investigating. I am including @types/node in dependencies as the library exports some node types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants