Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Adding node module to react-npm-portlet example shows weird error.
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
install goes through fine, however when I import something from react-bootstrap I get following error in chrome:
This also happens with other react node modules. Am I doing something wrong?
Hope I posted in right place, appreciate any help. Thanks
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
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.
so how would you import react-bootstrap? or react-bootstrap-table libraries?
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).