themes
themes copied to clipboard
[gatsby-theme-i18n] Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
I'm running into this error with gatsby-theme-i18n:

This seems to be related to hot reloading because when I delete the cache and run it for the first time I see translated pages as expected. Therefore, I think that the theme is configured properly. Also there is no obvious reason why I would not have access to path
(Node's path module) inside the gatsby-config.js
.
So my question is this: is gatsby-theme-i18n under active development? Because it's not mentioned here: https://www.gatsbyjs.com/docs/how-to/adding-common-features/localization-i18n/. Or should I rather use gatsby-plugin-i18n or am I supposed to roll my own i18n?
@LekoArts Could you clarify?
@maiertech I just run into the same issue. Are you loading MDX content through plugins other than gatsby-source-filesystem
?
In my case, I was also using gatsby-source-contentful
, which also creates nodes with internal type Mdx
for Contentful rich text fields, but does not add the field fileAbsolutePath
to the node.
gatsby-theme-i18n
should skip Mdx
nodes that have not been created by gatsby-source-filesystem
, IMO.