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

Uncaught TypeError: Designer is not a constructor #413 #415

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
282 changes: 4 additions & 278 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
"bugs": {
"url": "https://github.com/pdfme/pdfme/issues"
},
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
"main": "dist/index.umd.js",
"module": "dist/index.es.js",
"types": "dist/types/index.d.ts",
"scripts": {
"dev": "npm-run-all --parallel devBuild:watch devBuildType:watch",
"devBuild:watch": "esbuild src/index.ts --bundle --outfile=dist/index.js --format=esm --watch",
"devBuild:watch": "esbuild src/index.ts --bundle --outfile=dist/index.es.js --format=esm --watch",
"devBuildType:watch": "tsc --emitDeclarationOnly --watch",
"build": "vite build && tsc --emitDeclarationOnly",
"clean": "rimraf dist",
Expand All @@ -44,7 +43,7 @@
"antd": "^5.9.4",
"form-render": "^2.2.16",
"hotkeys-js": "^3.8.7",
"pdfjs-dist": "^4.0.189",
"pdfjs-dist": "^3.11.174",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-moveable": "^0.30.3",
Expand All @@ -67,7 +66,6 @@
"process": "^0.11.10",
"vite": "^5.0.0",
"vite-plugin-css-injected-by-js": "^3.3.0",
"vite-plugin-top-level-await": "^1.3.1",
"vite-tsconfig-paths": "^4.2.1"
},
"peerDependencies": {
Expand All @@ -87,8 +85,8 @@
"^form-render/es/": "form-render/lib/",
"^rc-picker/es/": "rc-picker/lib/",
"^lodash-es$": "lodash",
"^pdfjs-dist$": "<rootDir>/__mocks__/pdfjs-dist.js",
"^pdfjs-dist/build/pdf.worker.mjs$": "<rootDir>/__mocks__/pdfjs-dist.js"
"^pdfjs-dist/legacy/build/pdf.js$": "<rootDir>/__mocks__/pdfjs-dist.js",
"^pdfjs-dist/legacy/build/pdf.worker.entry.js$": "<rootDir>/__mocks__/pdfjs-dist.js"
},
"resolver": "ts-jest-resolver",
"moduleFileExtensions": [
Expand Down
7 changes: 4 additions & 3 deletions packages/ui/src/helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist';
// TODO Update pdfjs-dist. (might be able to reduce the bundle size.)
// @ts-ignore
import * as pdfWorker from 'pdfjs-dist/build/pdf.worker.mjs';
GlobalWorkerOptions.workerSrc = pdfWorker;
import PDFJSWorker from 'pdfjs-dist/legacy/build/pdf.worker.entry.js';
import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist/legacy/build/pdf.js';
GlobalWorkerOptions.workerSrc = PDFJSWorker;

import hotkeys from 'hotkeys-js';
import {
Expand Down