Why am I getting the error "ENOENT: no such file or directory" when publishing a custom object in Oracle Visual Builder Studio?

If you used the CX Extension Generator to create the custom object UI, then you probably created a new extension rather than importing the existing one from VB Studio. You can use the Create New Extension button only the first time you configure your application in the environment. You can correct the issue by replacing the existing JavaScript in the gruntfile.js with the following code.

'use strict';
 
/**
 * Visual Builder application build script.
 * For details about the application build and Visual Builder-specific grunt tasks
 * provided by the grunt-vb-build npm dependency, please refer to
 * https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/app-builder-cloud&id=visual-application-build
 */
module.exports = (grunt) => {
    require('load-grunt-tasks')(grunt);
    grunt.initConfig({
        // disable images minification
        "vb-image-minify": {
            options: {
                skip: true,
            },
        },
        // configure requirejs modules bundling
        "vb-require-bundle": {
            options: {
                transpile: false,
                minify: true,
                emptyPaths: [
                    "vx/oracle_cx_fragmentsUI/ui/self/resources/js/utils/contextHelper",
                    "vx/oracle_cx_fragmentsUI/ui/self/resources/js/utils/actionsHelper",
                    "vx/oracle_cx_fragmentsUI/ui/self/resources/js/utils/callbackHelper",
                ],
            },
        },
    });
};