我有 Gastby 5.13.2,并且安装了
gatsby-plugin-preact
、preact
和 react-render-to-string
。当我尝试在开发模式下打开主页时,出现错误:
{
"codeFrame": "No codeFrame could be generated",
"sourcePosition": null,
"sourceContent": null
}
在控制台我得到
warn The path "/" errored during SSR.
没有 Preact 一切正常。这个错误有解决办法吗?
我不确定 Preact 是问题的根源。我在 Gatsby 网站上有以下一组软件包,它工作正常。
"dependencies": {
"@tailwindcss/typography": "0.5.10",
"asciidoctor": "2.2.6",
"gatsby": "5.13.2",
"gatsby-plugin-image": "3.12.0",
"gatsby-plugin-postcss": "6.12.0",
"gatsby-plugin-netlify": "5.1.1",
"gatsby-plugin-robots-txt": "1.8.0",
"gatsby-plugin-sitemap": "6.12.0",
"gatsby-source-filesystem": "5.12.0",
"gatsby-transformer-asciidoc": "4.12.0",
"gatsby-adapter-netlify": "1.0.1",
"gatsby-plugin-preact": "^7.13.1",
"preact": "^10.19.6",
"preact-render-to-string": "^6.4.0",
"lodash": "4.17.21",
"react": "18.2.0",
"react-dom": "18.2.0",
"slash": "1.0.0"
}