Skip to content

Commit 7743a77

Browse files
committed
Fix ERR_INTERNAL_ASSERTION
1 parent bdeabc7 commit 7743a77

File tree

9 files changed

+2878
-1832
lines changed

9 files changed

+2878
-1832
lines changed

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@sipec/vue3-tags-input": "^3.0.4",
2222
"bootstrap": "5.3.3",
2323
"buffer": "^6.0.3",
24+
"isomorphic-dompurify": "2.26.0",
2425
"luxon": "^3.3.0",
2526
"stream-browserify": "^3.0.0",
2627
"vue": "^3.4.30",

client/src/markdown-converter-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { MarkdownConverter } from "@fumix/fu-blog-common";
2-
import DOMPurify from "dompurify";
2+
import DOMPurify from "isomorphic-dompurify";
33

44
export class MarkdownConverterClient extends MarkdownConverter {
55
private static instance: MarkdownConverterClient;
66

7-
protected override dompurify: DOMPurify.DOMPurifyI = DOMPurify;
7+
protected override dompurify = DOMPurify();
88

99
private constructor() {
1010
super((url: string) => fetch(url).then((it) => it.text()));

common/package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@
1010
"test": "node --test --loader ts-node/esm tests/**/*.ts"
1111
},
1212
"dependencies": {
13-
"dompurify": "^3.0.1",
14-
"highlight.js": "^11.9.0",
15-
"jsdom": "^25.0.0",
16-
"marked": "^14.1.2",
17-
"marked-highlight": "^2.1.3",
18-
"marked-mangle": "^1.1.8",
19-
"node-fetch": "^3.3.1",
13+
"isomorphic-dompurify": "2.26.0",
14+
"highlight.js": "10.7.3",
15+
"jsdom": "25.0.0",
16+
"marked": "14.1.2",
17+
"marked-highlight": "2.1.4",
18+
"marked-mangle": "1.1.9",
19+
"node-fetch": "3.3.2",
2020
"pako": "2.1.0",
21-
"sha.js": "^2.4.11"
21+
"sha.js": "2.4.11"
2222
},
2323
"devDependencies": {
24-
"@types/dompurify": "^3.0.0",
2524
"@types/jsdom": "^21.1.1",
2625
"@types/node-fetch": "^2.6.2",
2726
"@types/pako": "^2.0.0",

common/src/markdown-converter-common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DataUrl } from "@common/util/base64.js";
22
import { Buffer } from "buffer";
3-
import { DOMPurifyI } from "dompurify";
3+
import { DOMPurify } from "dompurify";
44
import highlightjs from "highlight.js";
55
import { marked, MarkedExtension, Token, Tokens } from "marked";
66
import { markedHighlight } from "marked-highlight";
@@ -91,7 +91,7 @@ export abstract class MarkdownConverter {
9191
};
9292
};
9393

94-
protected abstract dompurify: DOMPurifyI;
94+
protected abstract dompurify: DOMPurify;
9595

9696
/**
9797
*

common/src/util/mimeType.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ export function determineMimeType(bytes: Uint8Array | Buffer): SupportedFileMime
3838
return undefined;
3939
}
4040

41-
function doMagicBytesMatch(magicBytes: readonly number[], allBytes: Uint8Array | Buffer) {
41+
function doMagicBytesMatch(magicBytes: readonly number[], allBytes: Uint8Array) {
4242
if (magicBytes.length > allBytes.length) {
4343
return false;
4444
}
45-
const bytes = (allBytes as Uint8Array) ?? new Uint8Array(allBytes, 0, magicBytes.length);
45+
const bytes = (allBytes as Uint8Array) ?? new Uint8Array(allBytes.buffer, 0, magicBytes.length);
4646
return magicBytes.length < allBytes.length && magicBytes.every((it, i) => bytes[i] === it);
4747
}

docker/app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Build FRONTEND and COMMON and BACKEND Node Server
22
FROM node:22-slim
3-
RUN apt-get update && apt-get upgrade -y && apt-get install fonts-roboto -y
3+
RUN apt-get update && apt-get upgrade -y && apt-get install fonts-roboto build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev -y
44
EXPOSE 5000
55
WORKDIR /app
66
COPY . .

0 commit comments

Comments
 (0)