Что react-loadable нужно оборачивать в Loader?

Что нужно оборачивать в Loader, только компоненты для маршрутов в react-router (сами контейнеры) или можно и сами компоненты, которые на них находятся ?

После оборачивание, компонентов получаю ошибки, типа

server run on port 4000
(node:36) UnhandledPromiseRejectionWarning: Error: Not supported
at loader (/usr/src/app/src/designSystem/elements/SliderQuotes/index.js:5:13)
at load (/usr/src/app/node_modules/react-loadable/lib/index.js:28:17)
at init (/usr/src/app/node_modules/react-loadable/lib/index.js:121:13)
at flushInitializers (/usr/src/app/node_modules/react-loadable/lib/index.js:310:19)
at /usr/src/app/node_modules/react-loadable/lib/index.js:322:5
at new Promise (<anonymous>)
at Function.Loadable.preloadAll (/usr/src/app/node_modules/react-loadable/lib/index.js:321:10)
at Object.<anonymous> (/usr/src/app/src/server.js:181:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at loader (/usr/src/app/node_modules/babel-register/lib/node.js:144:5)
(node:36) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 20)
(node:36) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


То есть как я понимаю Loader не может находится внутри Loader'a ?

то есть я не могу импортировать на страницу компонент
-containers
--Page (folder)
---index.js (тут я импортирую лоадером страницу ниже)
---Page.js

-components
-- TestComponent
---index (лоадер для компонента)
---TestComponent.js

можно ли на страницу Page.js импортировать компонент из папки TestComponent с помощью файла index.js ?
  • Вопрос задан
  • 50 просмотров
Решения вопроса 1
RazerVG
@RazerVG Автор вопроса
FrontEnd
Ошибка возникали из-за использования preloadAll, вместо preloadReady
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы