Hi Team,
We seen below client-lib 400 error in new relic dashboard & directly we are not creating this lib into the code, please suggest any solution for this issue.
1. /etc.clientlibs/clientlibs/index.js.map
2. /etc.clientlibs/joshltd/clientlibs/clientlib-target/resources/target-devtool.js.map
Thanks & regard,
Vishal Bansal
Views
Replies
Total Likes
Hi @vishal-bansal-sbr ,
The 400 error for the client library files /etc.clientlibs/clientlibs/index.js.map and /etc.clientlibs/joshltd/clientlibs/clientlib-target/resources/target-devtool.js.map in AEM Cloud could be due to several reasons such as incorrect paths, missing files, or issues with the dispatcher configuration.
The .map files are typically source maps used for debugging JavaScript. They allow developers to view the original source code in the browser's developer tools, even after the code has been minified or compiled. A 400 error indicates a bad request, which usually means the server couldn't understand the request due to malformed syntax or an invalid file path.
Missing Source Map Files: Ensure that the source map files actually exist in the specified locations. Since you mentioned that these libraries are not directly created in your code, it's possible they are generated as part of a build process.
Solution:
Incorrect Path Configuration: Ensure that the paths specified for the client libraries are correct. Paths could be incorrect due to misconfiguration in the client library definitions.
Solution:
Dispatcher Configuration: The dispatcher might be blocking requests to these paths, resulting in a 400 error.
Solution:
Check the dispatcher configuration and ensure that the paths to the .map files are allowed.
Update the filter rules in the dispatcher configuration to allow access to source map files. For example:
/filter {
/0001 { /type "allow" /url "/etc.clientlibs/*" }
...
}
Check for Typographical Errors: A simple typo in the path or file name can result in a 400 error.
Solution:
Verify File Existence:
Review Client Library Configuration:
Update Dispatcher Configuration:
Check Build Process:
Review Logs:
Here’s an example of a client library configuration in AEM that includes source maps:
<clientLibraryFolder
jcr:primaryType="cq:ClientLibraryFolder"
allowProxy="{Boolean}true"
categories="[your-category]">
<js>
<js.txt><![CDATA[
target.js
target.js.map
]]></js.txt>
</js>
<css>
<css.txt><![CDATA[
target.css
target.css.map
]]></css.txt>
</css>
</clientLibraryFolder>
Ensure that the paths specified in js.txt and css.txt files are correct and that the referenced .map files exist.
By following these steps and verifying configurations, you should be able to resolve the 400 error for the client library files in AEM Cloud.
Views
Replies
Total Likes
@vishal-bansal-sbr Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies