js-datocms-client icon indicating copy to clipboard operation
js-datocms-client copied to clipboard

buildModularBlock is not a function

Open tholder opened this issue 2 years ago • 1 comments

Having trouble calling buildModularBlock.

import { SiteClient, buildModularBlock } from 'datocms-client'

console.log(buildModularBlock)

Returns undefined. Can't call this function. I've looked through the code here and can't quite determine what's going on. The following hints at a similar issue https://community.datocms.com/t/can-you-programmatically-create-blocks-in-plugins/2407

tholder avatar Apr 22 '22 03:04 tholder

If I import direct it seems to work:

import buildModularBlock from 'datocms-client/lib/utils/buildModularBlock'

tholder avatar Apr 22 '22 03:04 tholder