#[Flows] - Struggling using a library in a Run Script

7 messages · Page 1 of 1 (latest)

potent forge
#

Please share the error you're getting

dusty sentinel
#

There's no error msg. At this stage I tried something simple:

With this code nothing is displayed in the console.

import { Template, generate } from '@pdfme/generator';

module.exports = async function(data) {
console.log('Step reached');

return {};

}

With this one, the step msg is displayed in the console.

module.exports = async function(data) {
console.log('Step reached');

return {};

}
Hence my interrogation on the right way to import a JS library.

winter pulsar
#

can you try require instead of import?

#

also, it is quite anoying that there are no logs of run script unless you put everything into a try catch and then return the error msg

dusty sentinel
#

Here's the Script with require instead of import:

#

Here are the logs :

#

When the flow is triggered, nothing special is displayed in the console :