Documentation about "Using external Node libraries" deprecated

Hello,

Just wanted to make notice of the documentation about Using external Node libraries being deprecated.

The page says to use “ES6 module import syntax”, but when you try to use import inside an action, it throws the error Cannot use import statement outside a module.

In contrary to what the docs states, you can use require() instead.

import myModule from 'myModule'; // invalid

const myModule = require('myModule') // valid

myModule();

That is, if it’s even necessary. Pretty much all of the libraries I’ve added to UI Bakery have their default export automatically available.

// no require necessary
myModule(); //works!

Hello @Max!

Thank you for the note - we’ll check it on our side and make sure to update the docs as necessary.

Cheers,
Kate

1 Like

Hi again @Max

We’ve checked the docs, and the documentation you’ve sent is related to the Automations feature, not the regular actions. And they support different syntaxes, that’s why the current documentation is correct. For the 3rd parties libraries in the actions, please refer to this guide.

1 Like

Oh my, what an embarassing overlook on my side.

Thank you for checking Kate :slight_smile:

1 Like