-
-
Notifications
You must be signed in to change notification settings - Fork 478
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
nodenext: Module '"docx"' has no exported member 'Paragraph'. #2635
Comments
I'm also experiencing this, is anyone able to please help? I was able to use this module in pure JS but when switching to TS it won't compile and gives many errors which look like this:
The compiler will only seem to accept something like the following (non-sensical) code.
Which gives errors like
Here's my tsconfig,json
|
Same here, even if it seems to work in local context.
TS could not infer any of these types, tsc tells this: |
I can confirm the same issue. |
This issue stems from the fact that with recent versions of Node and ECMAScript, import statements in modules must include the actual post-transpilation file extension. TSC and Vite do not (and seemingly will not ever) rewrite import paths. The actual JavaScript module produced by the build is flattened into a single As an alternative to this simple and trivial fix in PR #2714 another option would be to update all relative path imports to include a file extension, but surely nobody would be foolish enough to... master...IntelliBridge-pwheeler:docx:modern-esm-typescript-support 🤦 |
Hello, Is there any update on this issue? I am also experiencing this. Thanks to @sflanker and anyone else working on this! |
Cannot import any other Types but document using Basic Usage Example
import { Document, Packer, Paragraph, TextRun } from "docx";
leads to following error: Module '"docx"' has no exported member 'Paragraph'
I tried several import variants, but none of them was working:
#1201, #2365
Is it a misconfiguration or an library issue? Any help appreciated!
Options:
The text was updated successfully, but these errors were encountered: