gatsby develop fails - reserved field name in the context object
See original GitHub issueHi, trying to use this plugin but receive the following error. Seems to be a conflict with Graphql. Any ideas for a workaround/override? Any suggestions gratefully received!
ERROR #11324
The plugin "gatsby-plugin-react-i18next" used a reserved field name in the context object when creating a page:
* "path"
{
...myObject...
}
Data in "context" is passed to GraphQL as potential arguments when running the
page query.
When arguments for GraphQL are constructed, the context object is combined with
the page object so *both* page object and context data are available as
arguments. So you don't need to add the page "path" to the context as it's
already available in GraphQL. If a context field duplicates a field already
used by the page object, this can break functionality within Gatsby so must be
avoided.
Please choose another name for the conflicting fields.
The following fields are used by the page object and should be avoided.
* "path"
* "matchPath"
* "component"
* "componentChunkName"
* "pluginCreator___NODE"
* "pluginCreatorId"
See the documentation for the "createPage" action — https://www.gatsbyjs.org/docs/actions/#createPage
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Troubleshooting Common Errors - Gatsby
If the error is describing an Unknown field 'X' on type 'Query' , the content type you are trying to source is likely...
Read more >Knex Query Builder
The heart of the library, the knex query builder is the interface used for building and executing standard SQL queries, such as select...
Read more >SyntaxError: function statement requires a name - JavaScript
The JavaScript exception "function statement requires a name" occurs when there is a function statement in the code that requires a name.
Read more >The Great Gatsby - Thomas Deacon Academy
At one point, Nick's neighbor “Gatsby” is mentioned and Daisy catches the name in surprise. Dinner is tense; Jordan reveals that it is...
Read more >better quality framework Entirely subjective. Better in what ways? I'd ...
I'd argue Gatsby and Next have different strengths, which is exactly what I said ... isn't absolute ✓ Fails if use a reserved...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The compilation was ok before, and the problem has been reproduced since today. It may be caused by the latest version upgrade. error message as below:
ERROR #11324
The plugin “gatsby-plugin-react-i18next” used a reserved field name in the context object when creating a page:
{ “path”: “/404.html”, “component”: “//src/pages/404.js”, “context”: { “path”: “/404”, “language”: “en”, “i18n”: { “language”: “en”, “languages”: [ “en” ], “defaultLanguage”: “en”, “generateDefaultLanguagePage”: false, “routed”: false, “originalPath”: “/404”, “path”: “/404” } }, “status”: “404” }
Data in “context” is passed to GraphQL as potential arguments when running the page query.
When arguments for GraphQL are constructed, the context object is combined with the page object so both page object and context data are available as arguments. So you don’t need to add the page “path” to the context as it’s already available in GraphQL. If a context field duplicates a field already used by the page object, this can break functionality within Gatsby so must be avoided.
Please choose another name for the conflicting fields.
The following fields are used by the page object and should be avoided.
See the documentation for the “createPage” action — https://www.gatsbyjs.com/docs/reference/config-files/actions#createPage
not finished createPagesStatefully - 0.465s
error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed. Exit code: 1 Command: C:\Users\charlie\AppData\Local\nvs\node\18.2.0\x64\node.exe
It is fixed in 2.0.4