Share Assets and Resources in Plugin Actions, action code

Hello
I’m trying to create a standalone plugin for qrcode generation using qrcode.js.
I want the plugin to be an action that can be included in a backend workflow. I’ll pass a url to the plugin which is to be encoded in a qrcode and passed back to the backend workflow.
I’ve included the qrcode.js library and the jquery library in the Shared Assets and Resources but cannot get the actions code to use them. I get the following error:

ReferenceError: QRCode is not defined at eval (eval at build_function (/var/task/index.js:86:21), :4:17) at /var/task/index.js:349:23 at run_fn (/var/task/u.js:594:18).

I’ve tried adding the libraries as scripts in the shared header but don’t know if this is seen by the actions code.
How can I load the libraries into the action code?
Many thanks

Couple of things-

  1. This library can’t be run in backend because this is frontend library. You need to pass the HTML elements into the library, so can’t be doable from the backend.

  2. You need to create the element into the plugin editor and load the library into newly created header not in the shared header.

Ankur@ Nocodetalks
Helping Bubble Devs to build No-Code Products. Follow me on Twitter

1 Like