Skip to content

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined in oct-23 branch when doing dashpub update #34

Description

@ugle1

Hi,

First of all, just to clarify what our goal is:
We want to set in package.json which app, title and app the dashpub app should load. This is a first step to containerizing it and set these parameters through environment variables.

When doing dashpub update in the oct-23 branch we see that the generateDashboards/generate function is broken.

We did the following:

  1. Installed from branch oct-23.
  2. Built a working dashboard using dashpub init. Tested with yarn dev.
  3. Cloned project directory and edited package.json to change to a different dashboard.
  4. dashpub update. Resulted in the following errors:
TypeError: generateDashboards is not a function
    at main (/home/user/node_modules/@splunk/dashpub/cli/cli.js:40:15)
  1. We work around this by uncommenting this line:
    //generateDashboards,
  2. The next error is:
Generating undefined dashboards...
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (node:internal/validators:162:11)
    at Object.join (node:path:1175:7)
    at generate (/home/user/node_modules/@splunk/dashpub/cli/builddash.js:93:23)
    at generateDashboards (/home/user/node_modules/@splunk/dashpub/cli/init.js:50:11)
    at main (/home/user/node_modules/@splunk/dashpub/cli/cli.js:40:15) {
  code: 'ERR_INVALID_ARG_TYPE'
}
  1. Which is worked around by hardcoding the app name here:
    await generateDashboards(project.dashboards, splunkdInfo, process.cwd());
  2. We changed this to the following, which resulted in dashpub update working again:
        await generateDashboards('ourappname', project.dashboards, splunkdInfo, process.cwd());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions