Closed FredrikSigvartsen closed 4 years ago
It looks like this is not an issue with Gatsby at all. The issue lies in gatsby-node.js
, where we use fnImagesToRelative
:
const { fmImagesToRelative } = require('gatsby-remark-relative-images')
...
exports.onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions
fmImagesToRelative(node) // convert image paths for gatsby images
if (node.internal.type === `MarkdownRemark`) {
const value = createFilePath({ node, getNode })
createNodeField({
name: `slug`,
node,
value,
})
}
}
This leads to all paths being an image, and therefore the path is changed to ../name-of-page
instead of /name-of-page
. I guess until this is fixed by either of these, I will go back to type the paths directly into the code, and not store it in a markdown file.
Thanks so much for opening this issue! As stated, this is slightly tangential to Gatsby, and it seems like you’ve already figured out the source of the problem.
If this is not the case, or if we can help further--please don’t hesitate to reach out or comment on this issue, and we’d love to take another look.
Thanks for using Gatsby :muscle:
Description
I'm getting really slow response time on some pages (up to 7 seconds). It looks like it is
page-data.json
that is causing this:I think these issues are somehow related, but I don't think the discussions there solves the problem:
Steps to reproduce
See heavy load time in production:
page-data.json
loading. Use Network in Inspector to see this.Other pages are okay. And this only happens in production, not with
gatsby develop
. You can find the source code for the reproduction above here: https://github.com/SEALAB-Software/website Navbar: https://github.com/SEALAB-Software/website/blob/master/src/components/Navbar/Navbar.js Gatsby page template: https://github.com/SEALAB-Software/website/blob/master/src/templates/bluethink-go-page.jsWe're using Netlify in production.
Expected result
Expect all pages to load somehow the same.
Actual result
Some pages uses up to 7 seconds to load.
Also, it looks like there is something wrong with Link from gatsby. Some Link-items are adding "../" in
href
:<a class="navbar-item is-tab" href="/../bluethink-go">BlueThink™ GO</a>
Environment