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!