RE: React-Modules Static CSS Files

thumbnail
Fredi B, modified 4 Years ago. Junior Member Posts: 69 Join Date: 4/1/20 Recent Posts
Greetings Liferay-Community,
we have developed multiple (20+) react-modules that are all created with the liferay-js:adapt-function of yeoman.
Most of them are quite simple but each of them come along with some CSS-Stylings. 
They all work fine but we can't find a solution how to fix these type of WARNings in the Console:

Console Output when requesting a page that has multiple react-modules (foreach module there is a WARN)  on it:​​​​​
2020-70-02 07:50:77.475 WARN  [http-nio-8080-exec-5][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map}
2020-70-02 07:50:77.475 WARN  [http-nio-8080-exec-7][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map}
2020-70-02 07:50:77.475 WARN  [http-nio-8080-exec-9][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map}
2020-70-02 07:50:72.472 WARN  [http-nio-8080-exec-7][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map}
2020-70-02 07:50:72.474 WARN  [http-nio-8080-exec-7][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map}
2020-70-02 07:50:72.475 WARN  [http-nio-8080-exec-2][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map}
2020-70-02 07:50:72.475 WARN  [http-nio-8080-exec-5][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map}
2020-70-02 07:50:45.797 WARN  [http-nio-8080-exec-8][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map}
2020-70-02 07:50:45.792 WARN  [http-nio-8080-exec-2][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map}
2020-70-02 07:50:45.792 WARN  [http-nio-8080-exec-7][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map}
2020-70-02 07:50:45.797 WARN  [http-nio-8080-exec-5][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map}
2020-70-02 07:50:55.457 WARN  [http-nio-8080-exec-8][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map}
2020-70-02 07:50:55.592 WARN  [http-nio-8080-exec-7][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map}
2020-70-02 07:50:55.828 WARN  [http-nio-8080-exec-9][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map}
2020-70-02 07:50:57.052 WARN  [http-nio-8080-exec-9][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map}
2020-70-02 07:50:57.552 WARN  [http-nio-8080-exec-70][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map}
2020-70-02 07:50:57.505 WARN  [http-nio-8080-exec-7][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.7fb22a45.chunk.css.map}
2020-70-02 07:50:57.579 WARN  [http-nio-8080-exec-5][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.295d777c.chunk.css.map}
2020-70-02 07:50:57.528 WARN  [http-nio-8080-exec-2][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-web/static/css/main.558b725a.chunk.css.map}
2020-70-02 07:50:57.554 WARN  [http-nio-8080-exec-9][code_jsp:750] {code="404", msg="ProxyServlet: /o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map", uri=/o/FIRMA-PLACEHOLDER-PLACEHOLDER-web/static/css/main.74245552.chunk.css.map}

Is there a way how we can generate such files or make Liferay find them or (if not possible) how we can stop Liferay from searching for these files?
Cheers,
Fredi
thumbnail
Christoph Rabel, modified 4 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Hmm, I just checked, looks like a bug in the tool to me. It is configured to use sourcemaps but it doesn't add them to the jar file.
Try this please:
Edit package.json and add the following flag to the build instruction.

  "scripts": {
    "start": "react-scripts start",
    "build": "GENERATE_SOURCEMAP=false react-scripts build",

It should work, but maybe you also need to add it to "build:liferay".
thumbnail
Fredi B, modified 4 Years ago. Junior Member Posts: 69 Join Date: 4/1/20 Recent Posts
Hello Christoph,Thank you for your answer.Sadly that does not result in any difference. Console is still printing out these warnings. Maybe anyone else got an idea how to fix the problem?
Cheers, Fredi
thumbnail
Christoph Rabel, modified 4 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
That surprises me.
Can you check the js/css files in the generated jar file? Unpack them and open them with an editor. Do they contain sourcemap entries? Something like this:
//# sourceMappingURL=main.74245552.chunk.css.map
One possible fix is to get rid of these lines (or to package them with the jar file). Adding "GENERATE_SOURCEMAP=false" should do that. BUT I tested this on Linux, so it might work there and not on Windows. But let's confirm that the sourceMappingURL is still there first.
Edit: Since you are probably on Windows, maybe this thread helps:
https://stackoverflow.com/questions/57093235/generate-sourcemap-false-issue