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

Error [ERR_REQUIRE_ESM]: require() of ES Module d3-polygon from @paddle-js-models\ocr not supported #2462

Open
kryptoniancode opened this issue May 28, 2024 · 2 comments
Assignees

Comments

@kryptoniancode
Copy link

Environment

Paddle OCR JS

  1. Using this create sveltekit app
npm create vite@latest
  1. Install paddlejs
npm i "@paddlejs/paddlejs-core"
npm i "@paddle-js-models/ocr"
  1. Use in app in Counter.svelte
import * as ocr from "@paddle-js-models/ocr";

Now following error occurs.

Problem description

Please attach the log file if there's problem happend.

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Projects\ocr-test\node_modules\d3-polygon\src\index.js from C:\Projects\ocr-test\node_modules\@paddle-js-models\ocr\lib\index.js not supported.
Instead change the require of C:\Projects\ocr-test\node_modules\d3-polygon\src\index.js in C:\Projects\ocr-test\node_modules\@paddle-js-models\ocr\lib\index.js to a dynamic import() which is available in all CommonJS modules.
@RomanczuG
Copy link

Did you solve the issue?

@kryptoniancode
Copy link
Author

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