Skip to main content

提供的源无法解析为值列表

以下错误消息:

提供的源 ([...]) 无法解析为值列表。
提供的源 ([...]) 无法解析为值列表。

可能发生在向 FontFace API 传递错误的语法时。

包括在 Remotion Lambda 中运行的 Chrome 104 在内的较旧版本的 Chrome 不支持不带引号的 FontFace 语法。

❌ 不带引号
txt
src: url(font.woff2) format(woff2);
❌ 不带引号
txt
src: url(font.woff2) format(woff2);
✅ 带引号
txt
src: url('font.woff2') format('woff2');
✅ 带引号
txt
src: url('font.woff2') format('woff2');

要解决此问题,请始终包含引号。
使用 @remotion/fonts 来使用一个帮助您避免此错误的抽象。