denoland / deno-gfm

Server-side GitHub Flavored Markdown rendering for Deno
https://jsr.io/@deno/gfm
MIT License
223 stars 36 forks source link

JSR and Client Side Rendering with gfm #126

Open mcgear opened 2 months ago

mcgear commented 2 months ago

https://github.com/denoland/deno-gfm/issues/119

We use esbuild to compile a control that is delivered to the client. This was previously working, we just upgraded to JSR and now with the latest version of GFM (0.8.2), we are getting error:

Error: Dynamic require of "path" is not supported
    at eacIslandsClient.js?revision=1723577690368:12:9
    at ../../../../../../AppData/Local/deno/deno_esbuild/postcss@8.4.41/node_modules/postcss/lib/map-generator.js (map-generator.js:4:43)
    at __require2 (eacIslandsClient.js?revision=1723577690368:18:50)
    at ../../../../../../AppData/Local/deno/deno_esbuild/postcss@8.4.41/node_modules/postcss/lib/lazy-result.js (lazy-result.js:4:20)
    at __require2 (eacIslandsClient.js?revision=1723577690368:18:50)
    at ../../../../../../AppData/Local/deno/deno_esbuild/postcss@8.4.41/node_modules/postcss/lib/postcss.js (postcss.js:5:18)
    at __require2 (eacIslandsClient.js?revision=1723577690368:18:50)
    at ../../../../../../AppData/Local/deno/deno_esbuild/sanitize-html@2.13.0/node_modules/sanitize-html/index.js (index.js:6:33)
    at __require2 (eacIslandsClient.js?revision=1723577690368:18:50)
    at https://jsr.io/@deno/gfm/0.7.0/mod.ts (mod.ts:8:26)

We are in the process of checking older version to see if they work, 0.7.0 does not seem to work either.

mcgear commented 2 months ago

Uppon further look, it seems the render is working. The issue happens in mod.ts at this line:

import sanitizeHtml from "npm:sanitize-html@^2.11";
jpsullivan commented 1 month ago

Yep seeing the same thing over here while attempting to integrate into a small Fresh app.