nx icon indicating copy to clipboard operation
nx copied to clipboard

@nrwl/react: Error during Storybook generation (TypeError: Cannot read properties of undefined (reading 'text'))

Open Lonli-Lokli opened this issue 3 years ago • 0 comments

Current Behavior

Error during storybook configguration creation

Expected Behavior

No errors

Steps to Reproduce

const AnyOfCustomOperatorComponentNew = (props: any) => {
  const onValueChanged = useCallback(
    e => {
      props.data.setValue(e.value && e.value.length ? e.value : null);
    },
    [props.data]
  );

 return (
    <div>test</div>
  );
};

Failure Logs

NX Cannot read properties of undefined (reading 'text')

TypeError: Cannot read properties of undefined (reading 'text') at getComponentPropsInterface (D:\sources\rmboa\node_modules@nrwl\react\src\utils\ast-utils.js:425:54) at getDefaultsForComponent (D:\sources\rmboa\node_modules@nrwl\react\src\utils\component-props.js:23:71) at findPropsAndGenerateFile (D:\sources\rmboa\node_modules@nrwl\react\src\generators\component-story\component-story.js:51:94) at D:\sources\rmboa\node_modules@nrwl\react\src\generators\component-story\component-story.js:38:17 at Array.forEach () at createComponentStoriesFile (D:\sources\rmboa\node_modules@nrwl\react\src\generators\component-story\component-story.js:37:28) at D:\sources\rmboa\node_modules@nrwl\react\src\generators\component-story\component-story.js:68:9 at Generator.next () at D:\sources\rmboa\node_modules\tslib\tslib.js:118:75 at new Promise ()

Environment

Node : 16.17.0 OS : win32 x64 npm : 8.15.0

nx : 14.7.5 @nrwl/angular : Not Found @nrwl/cypress : 14.7.5 @nrwl/detox : Not Found @nrwl/devkit : 14.7.5 @nrwl/eslint-plugin-nx : 14.7.5 @nrwl/express : 14.7.5 @nrwl/jest : 14.7.5 @nrwl/js : 14.7.5 @nrwl/linter : 14.7.5 @nrwl/nest : 14.7.5 @nrwl/next : Not Found @nrwl/node : 14.7.5 @nrwl/nx-cloud : Not Found @nrwl/nx-plugin : Not Found @nrwl/react : 14.7.5 @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 14.7.5 @nrwl/web : 14.7.5 @nrwl/workspace : 14.7.5 typescript : 4.8.3

Local workspace plugins:

Community plugins:

Lonli-Lokli avatar Sep 21 '22 16:09 Lonli-Lokli