Material-UI: Не удается найти модуль: './AccessAlarm' - PullRequest
0 голосов
/ 26 февраля 2020

У нас есть проект, использующий @ material-ui. Он построен на:

  • create-реагировать-приложение: 3.4
  • узел: 10.18.1
  • пряжа: 1.21.1
  • @ материал -ui: 4.9.x

Эта проблема странная: я могу yarn start и yarn build локально, версии точно такие же, как на сервере. Однако после того, как я отправил sh на сервер, произошел сбой:

[4/4] Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ @material-ui/icons@4.9.1
info All dependencies
└─ @material-ui/icons@4.9.1
Done in 8.27s.
+ yarn run build:dev
yarn run v1.21.1
$ cp .env.sample .env && react-scripts build
The following changes are being made to your tsconfig.json file:
  - compilerOptions.paths must not be set (aliased imports are not supported)

Creating an optimized production build...
Failed to compile.

./node_modules/@material-ui/icons/esm/index.js
Cannot find module: './AccessAlarm'. Make sure this package is installed.

You can install this package by running: yarn add ./AccessAlarm.

Этапы построения на сервере:

node -v
rm yarn.lock
rm -rf build node_modules
yarn install
yarn add @material-ui/core   // I have tried to run with and w/o these two lines
yarn add @material-ui/icons
yarn run build:dev

У кого-нибудь есть идеи по этому поводу? Спасибо.

1 Ответ

0 голосов
/ 26 февраля 2020

yarn cache clean делает свое дело.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...