当我下载 Gatsby 并从文件中删除模板图像时,我收到错误消息,并且服务器无法工作。当我将图像放回原处时,它再次起作用。我真的不知道这里发生了什么。
为什么没有他们放在那里的图像就不能使用模板,删除图像后它似乎完全崩溃了。
这些是我收到的错误消息:
ERROR #11321 PLUGIN
> icon (src/images/gatsby-icon.png) does not exist as defined in gatsby-config.js.
> Make sure the file exists relative to the root of the site.
ERROR
> There was an error compiling the html.js component for the development server.
> See our docs page on debugging HTML builds for help https://gatsby.dev/debug-html
> ENOENT: no such file or directory, open 'src/images/gatsby-icon.png'
38 |
39 | if (cacheBusting !== "none") {
> 40 | iconDigest = (0, _gatsbyCoreUtils.createContentDigest)(_fs["default"].readFileSync(pluginOptions.icon));
| ^
41 | }
42 | '''