svelte - 苗条:应用程序/ld+json
问题描述
使用以下代码:
<svelte:head>
<script type='application/ld+json'>
{
"@context": "https://schema.org",
"@type": "Organization",
"url": "https://filestar.com",
"logo": "https://filestar.com/logo-512.png"
}
</script>
</svelte:head>
在得到:
[svelte-preprocess] Error transforming 'ld+json'.
Message:
Cannot find module './transformers/ld+json'
Stack:
Error: Cannot find module './transformers/ld+json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Promise.resolve.then (C:\Repos\Filestar-Website\web-vnext\node_modules\svelte-preprocess\dist\utils.js:112:61)
我已经尝试了这个 github 线程中的建议,结果相同:https ://github.com/sveltejs/svelte/issues/2438
解决方案
看起来这与svelte-preprocess相关。尝试添加preserve: ['ld+json']
选项。
推荐阅读
- r - 调试自定义库安装失败
- python - RuntimeError: DataLoader worker (pid 2378) 被信号杀死:Killed
- node.js - 从其他控制器从 mongodb 获取数据时获取未定义结果
- javascript - 如何在 Sharepoint 列表分组视图中隐藏列名
- github - 尝试使用 CircleCI 推送到同一存储库时出现“致命:无法分叉”
- c# - 我怎样才能使 ac# 方法更通用?
- r - R CRAN 包安装失败
- git - 这4个git.exe在Windows OS下的具体区别是什么?
- javascript - 从数组中删除元素时未定义索引
- ios - 使用不同版本的 Xcode 创建的分支在 git 中真的不同吗?