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

Type definitions are not properly generated and typescript compile fails #913

Closed
hoancea opened this issue Apr 24, 2023 · 2 comments
Closed

Comments

@hoancea
Copy link

hoancea commented Apr 24, 2023

If I use the parse5 module in a new npm package and then run a typescript compile, I get errors from the inside the .d.ts files from the parse5 module. The compiler is complaining about the keyword type being included inside the brackets next to the import statements, and the compile succeeds if I manually remove those.

For example, inside index.d.ts in the published version, the first line is:
import { type ParserOptions } from './parser/index.js';
I manually adjusted this to:
import { ParserOptions } from './parser/index.js';
After applying this change in all .d.ts files, I was able to run typescript compile on my project.

I made a small project where I was able to replicate the issue. You should run into the same issue after running npm i && tsc. I am also uploading my output from running tsc.

Versions used:

  • node 18.14.2
  • npm 9.5.0
  • typescript 4.4.3
@wooorm
Copy link
Collaborator

wooorm commented Apr 24, 2023

Update TypeScript. Your TypeScript is very old.

Duplicate of #878

@hoancea
Copy link
Author

hoancea commented Apr 25, 2023

Thanks for your message

@hoancea hoancea closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2023
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