Skip to content

Can't build site on development. Error: can't resolve 'browser-lang' in '.../node_modules/gatsby-plugin-react-i18next/dist/plugin' #161

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
MrFacundo opened this issue Oct 24, 2022 · 3 comments

Comments

@MrFacundo
Copy link

MrFacundo commented Oct 24, 2022

Hi, I have that error message when trying to build on development mode.

I've tried installing packages "browser-lang" and "i18next-browser-languagedetector" via npm. I've also deleted node_modules, package-lock.json, run npm install, npm update, gatsby clean and the error persists.

This is in package.json:

"dependencies": {
"@fortawesome/free-brands-svg-icons": "^6.2.0",
"browser-lang": "^0.2.0",
"browser-monads": "^1.0.0",
"classnames": "^2.3.2",
"eslint": "^8.24.0",
"gatsby": "^4.24.2",
"gatsby-omni-font-loader": "^2.0.2",
"gatsby-plugin-image": "^2.24.0",
"gatsby-plugin-less": "^6.24.0",
"gatsby-plugin-manifest": "^4.24.0",
"gatsby-plugin-react-i18next": "^2.0.5",
"gatsby-plugin-sass": "^5.24.0",
"gatsby-plugin-sharp": "^4.24.0",
"gatsby-source-filesystem": "^4.24.0",
"gatsby-transformer-sharp": "^4.24.0",
"gsap": "^3.11.3",
"i18next": "^21.10.0",
"i18next-browser-languagedetector": "^6.1.8",
"less": "^4.1.3",
"less-loader": "^11.0.0",
"locomotive-scroll": "^4.1.4",
"node-sass": "^7.0.3",
"react": "^18.2.0",
"react-device-detect": "^2.2.2",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-i18next": "^11.18.6",
"react-loadable": "^5.5.0",
"react-responsive": "^9.0.0"
},

Any ideas on how to solve this issue?

@driuqzy
Copy link

driuqzy commented Oct 24, 2022

+1

Noticed:

  1. This repo updated the dep to 0.2.0 today 8b3c3f1

  2. browser-lang just released 0.2.0 last week: wiziple/browser-lang@81e55e2

@MrFacundo
Copy link
Author

MrFacundo commented Oct 24, 2022

Many thanks for the reply. I see now the issue is somehow related to an update. However, it's not really clear to me how should I proceed.
I've already installed the current versions of both this repo and browser-lang dependency. My package.json says I've "browser-lang": "^0.2.0" installed and package-lock.json says:

   "gatsby-plugin-react-i18next": {
      "version": "2.0.5",
      "resolved": "https://registry.npmjs.org/gatsby-plugin-react-i18next/-/gatsby-plugin-react-i18next-2.0.5.tgz",
      "integrity": "sha512-Nb37hBsHZwu7utply3dHWhJiNmCf871FMfB716Bb6RIuYl1+bvYqxQvcVHWLVdPQ/v3nI2ruqRP6jrJfMFbPcA==",
      "requires": {
        "bluebird": "^3.7.2",
        **"browser-lang": "^0.2.0",**
        "outdent": "^0.8.0",
        "path-to-regexp": "^6.2.0",
        "react-helmet": "^6.1.0"
      },

So, I understand gatsby-plugin-react-i18next and browser-lang should be good pals, at least in these versions of themselves.

Should I maybe try to install an older version of this repo?

EDIT: I've installed version 2.0.4 and successfully created a development build

@driuqzy
Copy link

driuqzy commented Oct 24, 2022

Same here, 2.0.4 works.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants