# \[solved\] Contrib-pdfmake node - help please getting node to work

**URL:** <https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867>\
**Category:** General\
**Created:** [29 July 2020 11:36 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867 "2020-07-29T11:36:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pazele](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@pazele](https://discourse.nodered.org/u/pazele)\
**Post date:** [29 July 2020 11:36 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/1 "2020-07-29T11:36:04Z")

</div>

Using both examples exactly as provided in Node-Red - simple pdf and image svg pdf.

Both examples give the debug error "TypeError: URLBrowserResolver is not a constructor".

Thinking I must be doing something simple incorrectly ?

Have tried in two browsers Chrome 84.0.4147.89 & FireFox 79.0  
Windows 10 64 bit environment  
Node-Red v 1.1.2  
Have "Googled" error and any other Node-Red flow examples without any joy

> **[node-red-contrib-pdfmake](https://flows.nodered.org/node/node-red-contrib-pdfmake)**
>
> a node to create pdf documents from a well defined json

  
Any help or suggestions will be appreciated  
Thanks

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 July 2020 12:14 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/2 "2020-07-29T12:14:02Z")

</div>

I just tried it and hit the same issue. I would open up an issue on the node's GitHub page [https://github.com/ollixx/node-red-contrib-pdfmake/issues](https://github.com/ollixx/node-red-contrib-pdfmake/issues)

---

<div class="post-metadata">

**Author:** ![pazele](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@pazele](https://discourse.nodered.org/u/pazele)\
**Post date:** [29 July 2020 22:26 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/3 "2020-07-29T22:26:11Z")

</div>

Thanks, have opened an issue on this node's GitHub page

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 July 2020 07:59 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/4 "2020-07-30T07:59:20Z")

</div>

I cloned the repo and changed the dependency in `package.js` for `pdfmake` to `"0.1.65"` - then installed like this...

```auto
npm install /my-local-github-clones/node-red-contrib-pdfmake

```

... and it works.

Looking at the `pdfmake` source, they added this `URLBrowserResolver` in v0.1.66

~~I am busy now raising an issue on their repo (will update this thread shortly)~~  
Raised issue on pdfmake repo...

> <https://github.com/bpampuch/pdfmake/issues/2037>
>
> Hi, pdfmake 0.1.65 & prior works perfectly well in NODE (v12) but since the addition of URLBrowserResolver.js in V0.1.66 the following...

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 July 2020 09:04 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/5 "2020-07-30T09:04:10Z")

</div>

If you want to get this working temporarily, a simple hack can be done until it is fixed...

- Locate `pdfmake.js` in your `.node-red` folder (likely location is `.node-red\node_modules\node-red-contrib-pdfmake\node_modules\pdfmake\build\pdfmake.js`)

- go to around line 21818 (search for `var URLBrowserResolver =`) then paste ABOVE that line, the following code...

- Save the file

- restart node-red

---

<div class="post-metadata">

**Author:** ![pazele](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@pazele](https://discourse.nodered.org/u/pazele)\
**Post date:** [1 August 2020 03:03 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/6 "2020-08-01T03:03:13Z")

</div>

Thank you for all the help with this item, very impressed with the turnaround and support.

Have updated to the new/current pdfmake v0.1.68 release and both supplied examples are working fine.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 August 2020 06:59 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/7 "2020-08-01T06:59:09Z")

</div>

Since the underlying pdfmake lib was fixed, a simple install should now work. The developer of the node-red contrib node seems to be unresponsive (shame).

---

<div class="post-metadata">

**Author:** ![pazele](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@pazele](https://discourse.nodered.org/u/pazele)\
**Post date:** [1 August 2020 08:16 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/8 "2020-08-01T08:16:05Z")

</div>

Thanks again.  
Yes, normal install worked for me. Removed previous release and then reinstalled (both using Node-Red 'Manage palette')

---

<div class="post-metadata">

**Author:** ![ollix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ollix/32/27306_2.png) [@ollix](https://discourse.nodered.org/u/ollix)\
**Post date:** [2 August 2020 15:16 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/9 "2020-08-02T15:16:35Z")

</div>

yes, so it seemed indeed.  
Unfortunately I did not receive notifications from github before the posts from Steve-Mcl and until now were not registered here (shame?).  
I have updated the node to use pdfmake v0.1.68 and it should all be fine now with node-red-contrib-pdfmake v1.0.3.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 August 2020 15:16 UTC](https://discourse.nodered.org/t/solved-contrib-pdfmake-node-help-please-getting-node-to-work/30867/10 "2020-08-16T15:16:53Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
