Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ugle1 opened this issue Dec 6, 2023 · 0 comments

Comments

@ugle1
Copy link

ugle1 commented Dec 6, 2023

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());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant