Cannot find module: '@blackbox-vision/ra-language-spanish'. Make sure this package is installed.
Hi,
Thanks for sharing Spanish translations for react-admin!
I've updated from 3.12 to 3.16 and found this issue. I've tried installing this library on a new React Admin project but didn't work.
yarn create react-app test-admin
cd test-admin/
yarn add react-admin ra-data-json-server prop-types
yarn build
That works until I installed this library:
yarn add @blackbox-vision/ra-language-spanish
yarn add v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "connected-react-router@^6.5.2".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "final-form@^4.20.2".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "react-final-form@^6.5.2".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "react-redux@^7.1.0".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "react-router@^5.1.0".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "react-router-dom@^5.1.0".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "redux@^3.7.2 || ^4.0.3".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "redux-saga@^1.0.0".
warning "react-admin > [email protected]" has unmet peer dependency "history@^4.7.2".
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > @blackbox-vision/[email protected]" has unmet peer dependency "ra-core@^3.14.0".
warning " > @blackbox-vision/[email protected]" has incorrect peer dependency "react@^16.11.0".
[4/4] Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ @blackbox-vision/[email protected]
info All dependencies
└─ @blackbox-vision/[email protected]
Done in 6.34s.
yarn build
yarn run v1.22.10
$ react-scripts build
Creating an optimized production build...
Failed to compile.
./src/App.js
Cannot find module: '@blackbox-vision/ra-language-spanish'. Make sure this package is installed.
You can install this package by running: yarn add @blackbox-vision/ra-language-spanish.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Is there something I wrong I'm doing or maybe installing wrong library version?
Hi @sebastianperruolo, thanks for use our lib.
I've followed your instructions creating a new react app using yarn and installing the package @blackbox-vision/ra-language-spanish with version "@blackbox-vision/ra-language-spanish": "^3.16.1" and no error appearing.
What node version you are using?
this is happening for me both locally and deploying to vercel
This happen when we run npm/yarn build
Would you mind to make a repro case repository? Also, which version of node/npm/yarn are you using?
@manutuero thanks for the quick response!
In the screenshot you attached I can't see if you added the import as following:
import spanishMessages from "@blackbox-vision/ra-language-spanish";
My node, npm and yarn versions are:
$ node --version
v14.17.1
$ npm --version
6.14.13
$ yarn --version
1.22.10
-import spanishMessages from "@blackbox-vision/ra-language-spanish"; +import spanishMessages from "@blackbox-vision/ra-language-spanish/pkg";
this works
Thanks @joshf that worked. That's not how it's mentioned on the README, right?.
It's not I am assuming it's a bug introduced when the repo moved
@sebastianperruolo @joshf In fact, the import in the latest version was wrong. We will release a new version to fix this problem. Thanks for reporting us!
@manutuero yes it fixes the problem