在 Observable 中导入和使用 remark & rehype 插件

import and use remark & rehype plugins in Observable

在 Observable 中导入 Stubborn 模块

借助 introduction of require, observable,我们可以在笔记本中使用数以千计的开源 JavaScript 模块。这在几年前运作良好。但是现在很少有笔记本开始 return 错误了。

我正在寻找一种在 Observable 中使用 remark & rehype 插件的方法。这是一个 example notebook that I would like to be able to run successfully. In this notebook, I noticed that the error was while requiring the module, so I tried updating it to the latest version (using require-debugger),但它 return 是一个空对象(下面的屏幕截图)。所以相关单元格returnnot a function错误

较新版本的 Observable 对 require 的支持是否有限?如果不是如何让它工作?

这个特定模块的解决方案可能是像这样加载它:

remark = import("https://cdn.skypack.dev/remark@14.0.1?min").then(d => d.remark)

请注意,此问题并非特定于 Observable,而是发生在上游(在 bundle.run 上)。我尝试使用 locally-hosted packd(支持 bundle.run 的软件)构建旧版本,但我得到了与 bundle.run.

上显示的错误相同的错误