V
V
Vladimir Golub2019-08-22 15:02:02
React
Vladimir Golub, 2019-08-22 15:02:02

What does react-loadable need to wrap in Loader?

What should be wrapped in Loader, only components for routes in react-router (containers themselves), or can the components themselves that are on them?
After wrapping, I get errors like

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.

That is, as I understand Loader cannot be inside Loader'a?
that is, I can't import the component into the page
-containers --Page
(folder)
---index.js (here I import the page below with the loader)
---Page.js
-components
-- TestComponent
---index (loader for the component )
---TestComponent.js
Is it possible to import a component from the TestComponent folder into the Page.js page using the index.js file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Golub, 2019-08-23
@RazerVG

The error occurred due to the use of preloadAll, instead of preloadReady

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question