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
Client Extensions JS not found
Hello comunity,
I try to run some client extensions on Liferay DXP 7.4.13u68. For this, I downloaded the samples from github and deployed the "liferay-sample-custom-element-2" in the ../osgi/client-extensions directory. Within my webapp I can see the deployment of the extension in the "Client Extensions" overview. But if I add the extension to a page, it is not visible. The debug console in my browser shows status code 404 for the main.js.
This is the yaml configuration
assemble:
- from: build/static
into: static
liferay-sample-custom-element-2:
cssURLs:
- css/main.*.css
friendlyURLMapping: liferay-sample-custom-element-2
htmlElementName: liferay-sample-custom-element-2
instanceable: false
name: Liferay Sample Custom Element 2
portletCategoryName: category.client-extensions
type: customElement
urls:
- js/main.*.js
useESM: true
and the browser console
In the .zip File the main.js is in the /static subdirectory, so I tried to change this in the yaml file. The final result is the same.
What is the correct link for the main.js
kind regards
Wladimir
Hi Wladimir,
do you found any solution for this?. Getting same error here.
Cheers
Hi Elvis,
I found another way to deploy JavaScript. You can pload your script in "Condent and Data" of the site und use this file as Client Extension.
After uploading the script und select it, you can click the infobutton in the right upper corner, in this info there are two urls. You can use the webdav url as javascript url in the client extension configuration of liferay.
I wish you success
Wladimir
Hello All ,
I am facing the same issue with 404 . Did anyone find a solution to it ? Following are the tomcat logs .
TIA
Manish
2024-09-02 15:09:52.302 ERROR [fileinstall-directory-watcher][ArtifactURLUtil:106] Path /Users/manish/Documents/LIFERAY/Liferay%20Setup/15June2024/tomcat2/liferay-dxp/osgi/client-extensions/liferay-sample-custom-element-2.zip is not a valid ZIP
java.io.FileNotFoundException: /Users/manish/Documents/LIFERAY/Liferay%20Setup/15June2024/tomcat2/liferay-dxp/osgi/client-extensions/liferay-sample-custom-element-2.zip (No such file or directory)
at java.util.zip.ZipFile.open(Native Method) ~[?:1.8.0_311]
at java.util.zip.ZipFile.<init>(ZipFile.java:226) ~[?:1.8.0_311]
at java.util.zip.ZipFile.<init>(ZipFile.java:155) ~[?:1.8.0_311]
at java.util.zip.ZipFile.<init>(ZipFile.java:126) ~[?:1.8.0_311]
at com.liferay.portal.osgi.web.wab.generator.internal.artifact.ArtifactURLUtil._isClientExtensionZip(ArtifactURLUtil.java:90) [bundleFile:?]
at com.liferay.portal.osgi.web.wab.generator.internal.artifact.ArtifactURLUtil.transform(ArtifactURLUtil.java:73) [bundleFile:?]
at com.liferay.portal.osgi.web.wab.generator.internal.artifact.WarArtifactUrlTransformer.transformURL(WarArtifactUrlTransformer.java:47) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._install(DirectoryWatcher.java:572) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._install(DirectoryWatcher.java:608) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher._process(DirectoryWatcher.java:807) [bundleFile:?]
at com.liferay.portal.file.install.internal.DirectoryWatcher.run(DirectoryWatcher.java:298) [bundleFile:?]
2024-09-02 15:09:52.771 INFO [fileinstall-directory-watcher][BundleStartStopLogger:68] STARTED liferaysamplecustomelement2_7.4.13 [1456]
2024-09-02 15:09:53.151 ERROR [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.client.extension.type.configuration.CETConfiguration~liferay-sample-custom-element-2)][FeatureFlagsBag:90] Feature flag LPS-202104 is not available for company 0
2024-09-02 15:10:03.129 WARN [http-nio-8080-exec-3][code_jsp:161] {code="404", msg="/liferay-sample-custom-element-2/js/main.a171cef1.js", uri=/o/liferay-sample-custom-element-2/js/main.a171cef1.js}
2024-09-02 15:10:50.928 WARN [http-nio-8080-exec-3][code_jsp:161] {code="404", msg="/liferay-sample-custom-element-2/js/main.a171cef1.js", uri=/o/liferay-sample-custom-element-2/js/main.a171cef1.js}
Powered by Liferay™