[qgis-qwc2] Problems getting the qwc2 app running since webpack 5

Daniel Cebulla daniel.cebulla at jena.de
Tue Feb 1 05:42:26 PST 2022


Hello qwc2 community,

I have running a qwc2-app based on the qwc2-demo-app, which is included 
in a qwc-docker-stack to use the qwc services. Since now the system uses 
an old version based on the qwc2-demo-app which uses webpack 4 for 
compiling.
Now I want to update the app based on a current release of the demo-app, 
but I can't get it running.

Starting the app itself with <npm install> and <npm start> works fine, 
it shows me the app in the browser. The problem is to get it running 
within the docker stack.

Just to recap, this should be the same for everyone:
Using <npm run prod> with webpack 4 the three files "QWC2App.js", 
"webpack-dev-server.js" and "webpack.js" were compiled within the dist 
folder. Now with webpack 5 it generates "QWC2App.js", "QWC2App.js.map" 
and a license file.

In addition the structure of the index.html file has changed. Before, 
the qwc2 app was inclued in the body section of the html file with this 
line:
<script src="dist/QWC2App.js"></script>

Now it is included in the head section with something like this:
</script><script defer="defer" 
src="dist/QWC2App.js?a619555e4c9b3e5b8e71"></script>

My problem is that the docker stack does not load this "new" app files. 
Building the docker stack, bringing the images up and generating all of 
the config files within the qwc admin panel works well. But loading the 
actual site, brings a blank page and not the compiled app.
It does not working either referencing the app in the body of the 
index.html like it was before or in the header as it is generated now.

Is there anyone with similar issues? Any idea what I am missing? Any 
configs I have to set or something else?

Thanks a lot for your help!
Greetings,
Daniel Cebulla


More information about the qgis-qwc2 mailing list