For Gatsby, While developing, the application works just fine till we started to build. We are encounter with the error listed down.
The following configuration we used looks like this:
gatsby-config.js
const path = require('path');
const { languages, defaultLanguage } = require('./languages');
const gatsbyRequiredRules = path.join(
process.cwd(),
'node_modules',
'gatsby',
'dist',
'utils',
'eslint-rules'
);
module.exports = {
siteMetadata: {
siteUrl: 'https://www.yourdomain.tld',
title: 'developer.xentral.com',
},
plugins: [
'gatsby-plugin-postcss',
'gatsby-plugin-image',
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-plugin-manifest',
options: {
icon: 'src/images/icon.png',
},
},
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: './src/images/',
},
__key: 'images',
},
{
resolve: 'gatsby-plugin-eslint',
options: {
rulePaths: [gatsbyRequiredRules],
stages: ['develop'],
extensions: ['js', 'jsx', 'ts', 'tsx'],
exclude: ['node_modules', 'bower_components', '.cache', 'public'],
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/locales`,
name: 'locale'
},
__key: 'locale',
},
{
resolve: 'gatsby-plugin-react-i18next',
options: {
localeJsonSourceName: 'locale',
languages,
defaultLanguage,
redirect: true,
generateDefaultLanguagePage: true,
// if you are using Helmet, you must include siteUrl, and make sure you add http:https
siteUrl: 'https://developer.example.com/',
// you can pass any i18next options
i18nextOptions: {
debug: true,
interpolation: {
escapeValue: false // not needed for react as it escapes by default
},
keySeparator: false,
nsSeparator: false
},
pages: [
{
matchPath: '/:lang?',
getLanguageFromPath: true,
},
]
}
},
],
};
Hi there!
For Gatsby, While developing, the application works just fine till we started to build. We are encounter with the error listed down. The following configuration we used looks like this:
gatsby-config.js
gatsby-node.js
languages.js
Pages folder structure is like this:
package.json
It fails on
build
script with the following error:Any idea of this error? Is there any updated example to follow? Not the ones from Gatsby documentation please.