Getting the above message on build if I try and run this in a beforeChange hook on a collection:
const createResult = createClientBlocks({
blocks: [
{
slug: `${data.id ?? ''}_${user.id}`,
fields: [],
}
],
defaultIDType: config.db.defaultIDType,
i18n: req.i18n,
importMap: importMap
})
Commenting it out resolves the issue. Apparently it's because downstream createClientField accesses the importMap with some components there importing scss files, and Node doesn't handle scss.
createClientBlocks is an utility exported from @subtle snow/payload. Weird thing is it seems to be called in various server contexts there.
Any ideas welcome on how to be able to run it server-side, or move it into client context.