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

Unable to use this package in React 17 #127

Open
mohituplers opened this issue Jul 25, 2024 · 3 comments
Open

Unable to use this package in React 17 #127

mohituplers opened this issue Jul 25, 2024 · 3 comments

Comments

@mohituplers
Copy link

Describe the bug
Not able to import anything from "docx-preview", it gives error "This dependency was not found: docx-preview".

I tried to add "main": "./dist/docx-preview.js" line in package.json inside node_module then it gives below error,

Module parse failed: Unexpected token (99:58)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     }
|     function hasXmlParserError(doc) {
>         return doc.getElementsByTagName("parsererror")[0]?.textContent;
|     }
|     function removeUTF8BOM(data) {
@mohituplers
Copy link
Author

@dmitri-gb @champkeh @fangd1997 @enjineerds @jrclaypool @szabi
Can you please help

@champkeh
Copy link
Contributor

can you provide a reproducible projects or code samples?

@wangtangsheng
Copy link

@mohituplers you can use like this:

import { renderAsync } from 'docx-preview/dist/docx-preview';

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

3 participants