RE: Adding node module to react-npm-portlet example shows weird error.

Amos Fong, modified 7 Years ago. New Member Post: 1 Join Date: 3/23/18 Recent Posts
I have created new liferay workspace through blade CLI. After that I have cloned the liferay-blade-samples repo.

I also deployed simple react tic-tac-toe app from gradle/apps/npm/react-npm-porlet using gradle build & blade deploy. Tic tac toe example works fine in my liferay.

However when I want to continue development, for example install another react module, like react-bootstrap, it's not working.

I'm installing a module with
npm install react-bootstrap --save
from liferay-blade-samples/gradle/apps/npm/react-npm-portlet.

install goes through fine, however when I import something from react-bootstrap I get following error in chrome:

home:616 Error: Error processing module: react-bootstrap@0.32.1/lib/Media. The provided configuration is not Directed Acyclic Graph.
    at DependencyBuilder._visit (everything.jsp?brows…1521807078217:13390)
    at DependencyBuilder._visit (everything.jsp?brows…1521807078217:13440)
    at DependencyBuilder._visit (everything.jsp?brows…1521807078217:13440)
    at DependencyBuilder._visit (everything.jsp?brows…1521807078217:13440)
    at DependencyBuilder._visit (everything.jsp?brows…1521807078217:13440)
    at DependencyBuilder._resolveDependencies (everything.jsp?brows…1521807078217:13356)
    at DependencyBuilder.resolveDependencies (everything.jsp?brows…1521807078217:13254)
    at everything.jsp?brows…1521807078217:14566
    at new Promise (<anonymous>)
    at Loader._resolveDependencies (everything.jsp?brows…1521807078217:14562)
(anonymous)	@	home:616
(anonymous)	@	everything.jsp?brows…1521807078217:14116
Promise.then (async)		
require	@	everything.jsp?brows…1521807078217:14094
(anonymous)	@	home:611</anonymous>


This also happens with other react node modules. Am I doing something wrong?

Hope I posted in right place, appreciate any help. Thanks
thumbnail
David H Nebinger, modified 7 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Liferay 7 already includes Bootstrap 3. Trying to also load bootstrap on your own is likely to fail. Trying to load bootstrap 4 is likely to fail.
john mcckiiney, modified 6 Years ago. New Member Posts: 10 Join Date: 3/17/17 Recent Posts
so how would you import react-bootstrap? or react-bootstrap-table libraries?
thumbnail
Ivan Zaera, modified 6 Years ago. Regular Member Posts: 119 Join Date: 10/1/13 Recent Posts
Nothing with cyclic dependencies will work until this one is implemented -> https://github.com/liferay/liferay-amd-loader/issues/182 (please visit the issue for a discussion on possible alternatives).