Select to view content in your preferred language

Print Widget Error: Cannot Read Properties of null (reading defaultValue)

1293
2
Jump to solution
09-21-2022 12:19 PM
AdrienFrench
Emerging Contributor

Hi,

I am having issues setting up the Print Widget using API version 4.24. I am getting the following error in the browser console: 
Uncaught TypeError: Cannot read properties of null (reading 'defaultValue')
See the attached screenshot for the full error.

My printer widget code is fairly simple:

 

new Print({
            view: view,
            printServiceUrl: url,
            container: "print-container",
            templateOptions: {
                legendEnabled: false,
            }
        });

 

 

Interestingly, when I use the printServiceUrl provided in the examples (https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%...) the printing service works, but when I use our own REST API, I get the error mentioned above. Does anyone have any suggestions as to how we can resolve this issue, either through the JS code, or through the REST API?

Thanks in advance,

Adrien French

0 Kudos
1 Solution

Accepted Solutions
AdrienFrench
Emerging Contributor

Apologies for the (very) late reply. We managed to resolve the situation, though I'm not sure why. We simply created a new print service and made sure to set all the default options, and that seems to have worked.

View solution in original post

2 Replies
Noah-Sager
Esri Regular Contributor

Hi @AdrienFrench, sorry to hear about the issue. What version of Server is your print service using? Is it a custom print service, or out of the box from Server? If custom, was it created with ArcGIS Pro or ArcMap? Feel free to message me the URL to the print service (if it's accessible) and I can take a look as well.

0 Kudos
AdrienFrench
Emerging Contributor

Apologies for the (very) late reply. We managed to resolve the situation, though I'm not sure why. We simply created a new print service and made sure to set all the default options, and that seems to have worked.