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

TS2314: Generic type 'Array<T>' requires 1 type argument #74

Closed
5 of 7 tasks
tomasbruckner opened this issue Apr 18, 2018 · 6 comments
Closed
5 of 7 tasks

TS2314: Generic type 'Array<T>' requires 1 type argument #74

tomasbruckner opened this issue Apr 18, 2018 · 6 comments

Comments

@tomasbruckner
Copy link
Contributor

tomasbruckner commented Apr 18, 2018

Hello,

When I try to import fast-xml-parse in TypeScript, it throws TS2314 error.

  • Are you running the latest version?
  • Have you included sample input?
  • Have you included actual output or error?
  • Have you included expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?
  • Did you bookmarked the repository for further updates? ;)

Input

Please include your sample code or steps to reproduce here

// index.ts
import { parse } from "fast-xml-parser"

parse('<html></html>')

Output

$ tsc index.ts 
node_modules/fast-xml-parser/src/parser.d.ts(34,25): error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

Expected data

No error is thrown.

Additional info

$ tsc -v
Version 2.7.2
tomasbruckner pushed a commit to tomasbruckner/fast-xml-parser that referenced this issue Apr 18, 2018
tomasbruckner added a commit to tomasbruckner/fast-xml-parser that referenced this issue Apr 18, 2018
@amitguptagwl
Copy link
Member

type script in not fully implemented in fast-xml-parser yet. Please refer #71 .If it cause any issue. I can remove parser.d.ts from fxp.

@tomasbruckner
Copy link
Contributor Author

@amitguptagwl it should be fixed with PR #75
If I understood NIMN schema correctly, Array contains either object or string. Can anybody confirm?

@amitguptagwl
Copy link
Member

@tomasbruckner Thanks for the PR. For the Nimn format, an array can contain either a string or object or an array.

amitguptagwl added a commit that referenced this issue Apr 18, 2018
@tomasbruckner
Copy link
Contributor Author

@amitguptagwl Could you please publish the lastest version to NPM? I still see 3.3.8 on NPM site and I need the bug fix in my project :)

@amitguptagwl
Copy link
Member

Done :)

@tomasbruckner
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants