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: JS Module with Blade : can't use require()
Hi,
I'v created a portlet with Eclipse Liferay IDE, npm-react-portlet. Everything works fine except for to main issues :
Both of above methods (require and imports css/images) are not working and results in the same error : no portlet and this error in dev console
I've already installed and using the preset es2016 for Babel. Is this an issue with Babel ? Do I need to install something else ?
Thanks a lot
I'v created a portlet with Eclipse Liferay IDE, npm-react-portlet. Everything works fine except for to main issues :
- I can't user the method "require()" for style or image
- I can't use "import" on css or images
Both of above methods (require and imports css/images) are not working and results in the same error : no portlet and this error in dev console
Load timeout for modules: metal-dom/src/all/dom,metal-uri/src/Uri,clay-tooltip/src/ClayTooltip,agiir-petitesannonces@1.0.0
I've already installed and using the preset es2016 for Babel. Is this an issue with Babel ? Do I need to install something else ?
Thanks a lot
Hi Nils:
Unfortunately we don't support import for static resources yet. You can track the progress of its implementation here: https://github.com/liferay/liferay-npm-build-tools/issues/303
Alternatively, if you want to contribute that support to make arrive faster, I can guide you on how it could be done :-).
Cheers,
Ivan
Unfortunately we don't support import for static resources yet. You can track the progress of its implementation here: https://github.com/liferay/liferay-npm-build-tools/issues/303
Alternatively, if you want to contribute that support to make arrive faster, I can guide you on how it could be done :-).
Cheers,
Ivan
Hi Ivan,
Alright thanks for the information.
I don't see myself as a very good developer to contribute on that feature but I'll wait for this to be available
Alright thanks for the information.
I don't see myself as a very good developer to contribute on that feature but I'll wait for this to be available

Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™