This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Fails To Load JavaScript Reference

hazardscout wrote on 2014-10-14:
I'm using PDF Crowd in NodeJS to render some HTML as a PDF. For a few months it worked perfectly, but two weeks ago the graphs stopped showing. When I render the HTML in a browser, everything looks perfect.

After debugging, I noticed that PDFCrowd never loads my main script:
<script src="https://web.hazstatic.com/modules/bundles/layout-part1.min-C31A2436CA2D16239BCAB95E496D2561.js"></script>


But other scripts load fine:
<script src="https://web.hazstatic.com/modules/bundles/report-download-pdf.min-1F51AEEB8C92E0460075BDA38BB6AADD.js"></script>


These are static files served through CloudFront.

The script that fails to load is large at 238KB but other larger scripts load fine. I've read the Limitation docs and I'm well under the 40 second, 20MB upload, 100MB download, 8 redirects, and 2000 resources limits.

Is there a way to understand why PDF Crowd won't load this script?
hazardscout wrote on 2014-10-14:
I've finally discovered and fixed the issue. I doubt it will help anyone, but I'll post my fix anyways.

I have a short jQuery plugin called notify that shows notifications at the top of the page. This lib would not load in PDF Crowd. When bundled with other scripts, it caused the whole bundle to fail to load in PDF Crowd (but worked in Chrome, Safari, etc).

Ultimately I was able to identify the cause - the script used the javascript keyword `class` as a key on an object. This revision fixed the issue and caused the bundle to load properly.
support wrote on 2014-10-15:
Hello,

Thank you for reporting this. Indeed, using a JS keyword as a property name confuses the JS parser we use. A workaround is to use obj['class'] instead of obj.class