Closed gusbemacbe closed 4 years ago
Hello Gatsby developers!
These two projects that you created are not only that were affected other several projects I tried to build also are affected:
@angeloocana's gatsby-plugin-i18n; @smakosh's gatsby-starter-i18n; @theodesp's All You Need to Know About i18n with Gatsby
I also have already tried to remove package-lock
and yarn-lock
, and node_modules
, but Gatsby and NPM kept upgrading the latest version when I installed other packages via npm
. Same errors, Observe that I always ordered alphabetically the plugins in the file gatsby-config.json
, but I also reverted to the original order and it still gave same errors. I think it is gatsby-cli
's problem and or because Gatbsy and NPM forced to upgrade the latest verison, brekaing a lot of projects. It killed a lot of projects.
I am a Gatsby's new learner, I learned a lot of things. I found it complete, easy and powerful. I spent 3 days, trying to fix these errors, but a lot of these current problems make me giving up on Gatsby and migrating to other alternatives.
My starter needs to be updated as it is still using an old version of react-intl
, I will work on that during the weekends if I get some free time.
@smakosh,
It seems that your project is working as @sidharthachatterjee and @pvdz have fixed that. Sorry, @smakosh ! Should I close your project's my issue too?
Yes please, thank you!
@gusbemacbe I did update the article recently and the code hosted on github. I remember there were some issues with the latest CLI version so I tried to push older versions in the dependancies:
"dependencies": {
"gatsby": "^2.20.12",
"gatsby-plugin-manifest": "^2.1.1",
"gatsby-plugin-offline": "^2.1.1",
"gatsby-plugin-react-helmet": "^3.0.12",
"gatsby-source-filesystem": "^2.0.38",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-helmet": "^5.2.1",
},
@theodesp
I have already hold these old versions,. but there are errors I apointed. I left the comment at your blog post. But I will copy here:
Χαίρετε Θεό!
I think you need to update a bit your tutorial because there are errors:
Can't resolve 'gatsby-plugin-i18next' in '/home/gusbemacbe/GitHub/suru-plus-folders/src/pages' If you're trying to use a package make sure that 'gatsby-plugin-i18next' is installed. If you're trying to use a local file make sure that the path is correct. File: src/pages/index.js
Because of
index.js
'simport { withI18next } from 'gatsby-plugin-i18next'
. Maybe do you meanimport { withI18next } from '@wapps/gatsby-plugin-i18next'
?Another error in the file
export default withI18next()(withTranslation()(NotFoundPage);
. I think you missed one parenthesis. Do you meanexport default withI18next()(withTranslation)()(NotFoundPage);
?It seems you also missed
import { withI18next } from 'gatsby-plugin-i18next'
in the filepage-2.js
.The
languageSwitcher.js
also has a problem, because Gatsby said:TypeError: availableLngs is undefined LanguageSwitcher src/components/languageSwitcher.js:5 2 | import { Language } from '@wapps/gatsby-plugin-i18next'; 3 | 4 | const LanguageSwitcher = ({ changeLng, lng, availableLngs }) => ( > 5 | <select onchange="{(e)" ==""> changeLng(e.target.value)}> 6 | { 7 | availableLngs.map((value) => ( 8 | <option key="{value}" selected="{lng" =="=" value}="">{value}</option>
And you also missed import Layout from '../components/layout';
in the file 404.js
because of Layout
as Gatsby has apointed.
Ah, @theodesp, I have been searching your Github repo. It seems that you published on other organisation. I found and see you have already updated as you had said. I will test. Thank you. I am very sorry!
Description
I downloaded a baisc and simple
using-i18n
from https://github.com/gatsbyjs/gatsby/tree/master/examples/using-i18n. I installed Gatsby plugin vianpm
. Finally I rangatsby develop
, and it gave errors. Thegatsby-starter-default
also has problems with the same errors. I think it is because ofgatsby-cli
.Steps to reproduce
using-i18n
npm
gatsby develop
and you'll receive the errors:using-i18n
:gatsby-starter-default
:Expected result
See the errors above
Actual result
See the errors above
Environment
using-i18n
:gatsby-starter-default
:I downgraded
gatsby-starter-default
and it worked. But the updated and originalgatsby-starter-default
(if you can not distinguish the versions, see below):Compare
gatsby-starter-default
updated fromnpm
with originalgatsby-starter-default
: