Open nartc opened 6 years ago
Just meet the same error message.
Problem come from onCreateNode
which reject my blog posts for not having 'isInPagesPaths' at true. By default, pagesPaths is ['/src/pages/']
.
So I "fix" this with a correct configuration (my markdowns are in content/blog
) :
{
resolve: 'gatsby-plugin-i18n',
options: {
langKeyDefault: 'en',
useLangKeyLayout: false,
pagesPaths: [`${__dirname}/content/blog`]
}
}
Hello guys, I'm trying to implement yours package on my website and I'm followed the README documentation, I do that is there but I'm catching this error:
ERROR #85901 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "langKey" on type "MarkdownRemarkFields".
File: node_modules/gatsby-plugin-i18n/createPages.js:46:10
This is the source with error: https://github.com/davidcostadev/davidcosta.com.br/pull/2
Hum... I did what @Charlynux suggest and works. But I think that its need to be added on README too
Sorry for flood, but I'm getting this error now:
Error: A plugin tried to update a node field that it doesn't own:
Node id: 7fc40a6e-82c9-5435-a8d6-aa777602b901
Plugin: default-site-plugin
name: slug
value: /hello-world/index.pt-br/
warn The plugin "gatsby-plugin-i18n" used a reserved field name in the context object when creating a page:
* "path"
{
"path": "/hello-world/",
"component": "/Users/davidcosta/workplace/fun/davidcosta.com.br/src/templates/blog-post.js",
"context": {
"path": "/hello-world/",
"slug": "/hello-world/",
"langKey": "en"
},
"layout": "en"
}
I can't fix it with pagesPaths setting.. Anyone? My code is available here
I can't reach langKey setting. Mine md structure is a little bit different.
Thanks.
Just in case someone else end up here, after applying Charlynux's suggestion I also faced the error:
Error: A plugin tried to update a node field that it doesn't own:
After doing some digging here's what fixed for me: https://github.com/gaearon/overreacted.io/commit/18c7308
Also, don't forget to add
fields {
langKey
}
to your query. It's obvious but I just spent an hour debugging why I couldn't access langKey
from inside the createPages definition 🤦
Thanks, @Charlynux and @lucsrods the combination of your insights made it work
Hi,
I'm trying to get
gatsby-plugin-i18n
to work with my blog. I keep getting this error when I rungatsby develop
and I couldn't find the solution anywhere.// my gatsby-config.js
Any help is appreciated. Let me know if you need to see anything else.