Skip to content

Bug: Cannot read properties of undefined (reading 'log') #15

@Lookwe69

Description

@Lookwe69

When i use this package to only use getTsProgram (not typeParserPlugin), i got a typeError

> @gac/gac-ui@4.1.4 make-metadata
> node ./scripts/make-metadata.js --outdir dist

file:///var/app/node_modules/@wc-toolkit/type-parser/dist/index.js:309
      log.log(
          ^

TypeError: Cannot read properties of undefined (reading 'log')
    at visitNode (file:///var/app/node_modules/@wc-toolkit/type-parser/dist/index.js:309:11)
    at visitNodes (/var/app/node_modules/@custom-elements-manifest/analyzer/node_modules/typescript/lib/typescript.js:28321:24)
    at forEachChildInSourceFile (/var/app/node_modules/@custom-elements-manifest/analyzer/node_modules/typescript/lib/typescript.js:28964:18)
    at Object.forEachChild (/var/app/node_modules/@custom-elements-manifest/analyzer/node_modules/typescript/lib/typescript.js:28406:37)
    at visitNode (file:///var/app/node_modules/@wc-toolkit/type-parser/dist/index.js:315:14)
    at getTsProgram (file:///var/app/node_modules/@wc-toolkit/type-parser/dist/index.js:129:7)
    at Object.overrideModuleCreation (file:///var/app/custom-elements-manifest.config.js:24:19)
    at run (file:///var/app/node_modules/@custom-elements-manifest/analyzer/cli.js:45:22)
    at cli (file:///var/app/node_modules/@custom-elements-manifest/analyzer/cli.js:95:28)

Node.js v22.16.0
node:internal/errors:983
  const err = new Error(message);
              ^

Error: Command failed: cem analyze --litelement --outdir "dist"
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:882:11)
    at execSync (node:child_process:954:15)
    at file:///var/app/scripts/make-metadata.js:10:1
    at ModuleJob.run (node:internal/modules/esm/module_job:274:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 348,
  stdout: null,
  stderr: null
}

Node.js v22.16.0

I want to only use getTsProgram because i no longer can use typeParserPlugin because of an another error #14 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions