Error during the add component process: TypeError: Cannot read properties of undefined

Created on 22 April 2024, 8 months ago
Updated 18 May 2024, 7 months ago

Problem/Motivation

In the latest dev build (dev-6.0.x 15a8615), running 'drupal-radix-cli add' leads to:

Error during the add component process: TypeError: Cannot read properties of undefined (reading 'name')
    at /home/mizpah/.nvm/versions/node/v21.7.1/lib/node_modules/drupal-radix-cli/cli.js:40:44
    at Array.map (<anonymous>)
    at addComponent (/home/mizpah/.nvm/versions/node/v21.7.1/lib/node_modules/drupal-radix-cli/cli.js:36:5)
    at /home/mizpah/.nvm/versions/node/v21.7.1/lib/node_modules/drupal-radix-cli/cli.js:218:10
    at Object.<anonymous> (/home/mizpah/.nvm/versions/node/v21.7.1/lib/node_modules/drupal-radix-cli/cli.js:231:3)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Module._load (node:internal/modules/cjs/loader:1021:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)

Steps to reproduce

Install and run 'drupal-radix-cli add'

Proposed resolution

tracing the error seems to relate to issues with the schemas. A manual trawl through the files reveals that:
web/themes/contrib/radix/components/fieldset/fieldset.component.yml
is in fact blank.

As a temporary fix, add the following:

$schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json
name: Fieldset
status: experimental

This creates 'enough' of the file to have a proper definition, and drupal-radix-cli add now runs as expected.

Remaining tasks

Examine web/themes/contrib/radix/components/fieldset/fieldset.component.yml and decide how it should be populated fully.

🐛 Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

🇬🇧United Kingdom martin@manarock.co.uk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024