Skip to content

Commit 8743bc2

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(files): preserve native PDF font path resolution
1 parent 907df80 commit 8743bc2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/sim/app/api/files/export/[id]/markdown-pdf.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { existsSync } from 'node:fs'
2-
import { createRequire } from 'node:module'
2+
import * as nodeModule from 'node:module'
33
import { join } from 'node:path'
44
import type { ReactNode } from 'react'
55
import {
@@ -39,7 +39,8 @@ interface PdfFont {
3939
glyphs: GlyphFont
4040
}
4141

42-
const require = createRequire(import.meta.url)
42+
/** A runtime anchor preserves Node filesystem paths instead of bundler module IDs. */
43+
const require = nodeModule.createRequire(join(process.cwd(), 'package.json'))
4344

4445
/**
4546
* Ensure a DOM exists for the TipTap Markdown parser used by this PDF-only server module. The

0 commit comments

Comments
 (0)