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

Legacy: Type declarations are broken in 4.0 #17241

Closed
lanwin opened this issue Nov 8, 2023 · 1 comment · Fixed by #17252
Closed

Legacy: Type declarations are broken in 4.0 #17241

lanwin opened this issue Nov 8, 2023 · 1 comment · Fixed by #17252
Labels

Comments

@lanwin
Copy link

lanwin commented Nov 8, 2023

Ive tested 4.0.189 from NPM and noticed that the type declaration file is broken for legacy with this version.

Error:
Could not find a declaration file for module 'pdfjs-dist/legacy/build/pdf.mjs'

The fix is simple. pdfjs-dist/legacy/build/pdf.d.ts should be renamed to pdfjs-dist/legacy/build/pdf.mjs.d.ts.

@tamuratak
Copy link
Contributor

The file name should be pdf.d.mts, not pdf.mjs.d.ts.

See https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md

A .d.mts file represents a .mjs file which is always an ES module; a .d.cts file represents a .cjs file which is always a CommonJS module; a .d.ts file represents a .js file whose module format is determined by the nearest package.json.

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

Successfully merging a pull request may close this issue.

3 participants