Docker image not working with print designer (Blank page, assets not loading)

Problem:
Print designer form popup is visible, but after selecting a template and defining its name, print designer will just show a white screen (except for the header).

Environment:

  • Docker Custom build
  • Frappe: v15.33.3
  • ERPNext: v15.29.2 prod
  • Print Designer: v1.4.0 (current main branch)

My findings so far:
Assets are unable to load (404). Docker custom build does run without any issues though and other custom apps are working fine too… not sure if print designer is even compatible with custom docker builds?

Please note, docker images for production are built different:

You cannot build assets using bench build in running production containers. It will mess up the attached assets volume for the container in which the command was executed. It will cause problems in serving static assets. The asset building process is done during the image build. Images come pre-packaged with built assets and there is no need to build assets in production environment.
Source: How we could restart the erpnext docker containers

There are similar reports I found: Introducing Print Designer : A brand new way of designing print formats 🖨️ - #40 by Pirated

Docker assets build output

print_designer/dist/js/
├─ pdf.worker.bundle.3CMFYJAV.js                            1174.92 Kb
├─ print_designer.bundle.GFQCLKMD.js                        1676.20 Kb
└─ print_designer.bundle.7SLXQ52O.css                       37.89 Kb

print_designer/dist/css/
├─ pdfjs.bundle.DDMDOH6N.css                                18.74 Kb
└─ print_designer.bundle.46ELZ7MW.css                       0.43 Kb

print_designer/dist/css-rtl/
├─ pdfjs.bundle.VPBXD2LQ.css                                18.78 Kb
└─ print_designer.bundle.J2ZTAUOZ.css                       0.43 Kb

 DONE  Total Build Time: 39.734s

Turned out to be a docker-specific issue. In order to replace your docker containers, you’ll need to remove them beforehand.

docker compose -p erpnext -f pwd.yml down
docker compose -p erpnext -f pwd.yml up -d

More about it here: 404 on css and js files · Issue #1309 · frappe/frappe_docker · GitHub