question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 (<anonymous>) 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 (<anonymous>) at D:\sources\rmboa\node_modules\tslib\tslib.js:118:75 at new Promise (<anonymous>)

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:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Lonli-Loklicommented, Sep 27, 2022

@mandarini thanks for fix, I totally forget about repro request

0reactions
mandarinicommented, Dec 21, 2022

Ok, so I’ll just push the above mentioned fix. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Storybook Cannot read properties of undefined (reading 'type')
The TypeError: Cannot read properties of undefined (reading 'type') exception occurs in storybook when one defines the argTypes in the ...
Read more >
storybook cannot read properties of undefined - You.com
The TypeError: Cannot read properties of undefined (reading 'type') exception occurs in storybook when one defines the argTypes in the default export object ......
Read more >
ArgTypes - Storybook - JS.ORG
ArgTypes are a first-class feature in Storybook for specifying the behaviour of Args. By specifying the type of an arg, you constrain the...
Read more >
@nrwl/react:storybook-configuration | Nx
This generator will set up Storybook for your React project. nx g @nrwl/react:storybook-configuration project-name.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found