Missing version of d3 in Docker container

Hello,

I currently have a local instance of Grafana set-up with custom panels built. In these panels, I am using various methods from D3. On my local instance, everything runs fine. However, when I build the image and run my container, I obtain the following error:

caught TypeError: Cannot read properties of undefined (reading 'transform')

For reference, I have mounted my plugins folder to /var/lib/grafana/plugins – and all my custom panels are shown and work (mostly) fine. From this exchange it seems like this may be a version issue. However, when I console.log(d3.version), my local instance logs v5.15.0, while the Docker build displays undefined. Furthermore, if I console.log(d3), ‘version’ is missing from the module. Any thoughts?

I am running Grafana 9.4.7 , Mac OS Ventura (Mac M1) and am using the --platform linux-amd64 tag in my image build.

I moved the topic from Communuty category as that is fo questions “about” the community. The whole forum website is a place to ask from the community…

I moved it to “Docker Desktop for Mac” based on your last sentence, but I don’t see how it could be a Docker issue. D3 is a Javascript library running on client side. To solve the issue would require D3 knowledge.

Let’s say it is somehow caused by Docker. Can you share any more log messages? From the container (docker logs) and from the webbrowser’s developer console? If a library was not successfully loaded because for example you forgot to copy it into the image or mount into the container, that could also cause “undefined” errors when a javascrip code tries to read an object which is undefined because the source file is not loaded.