react-docgen icon indicating copy to clipboard operation
react-docgen copied to clipboard

5.3.1 Warning: Cannot parse: Range Error: Maximum call stack size exceeded

Open stonebk opened this issue 4 years ago • 5 comments

I recently updated react-styleguidist which brought react-docgen to 5.3.1 and I started getting a lot of warnings:

Warning: Cannot parse src/components/Input/Input.jsx: RangeError: Maximum call stack size exceeded

It usually means that react-docgen does not understand your source code, try to file an issue here:
https://github.com/reactjs/react-docgen/issues

If I switch back to [email protected], all the warnings go away. I think it has something to do with using @component per the recommendation of react-styleguidist when using styled-components.

stonebk avatar Mar 29 '21 15:03 stonebk

Can you please provide an example of a component, which shows this behavior?

danez avatar Mar 30 '21 18:03 danez

import PropTypes from 'prop-types';
import styled from 'styled-components';
import { InputMixin } from '../../mixins/components/InputMixin';
import { INPUT_SIZES } from '../../constants/INPUT';
import FormControl from '../../js/FormControl';

/**                                                                                                                                                                                                                                           
 * An HTML text input component.                                                                                                                                                                                                              
 */
const Input = styled(FormControl)`                                                                                                                                                                                                            
    ${InputMixin}                                                                                                                                                                                                                             
`;

Input.displayName = 'Input';

Input.propTypes = {
    /**                                                                                                                                                                                                                                       
     * The size of the input.                                                                                                                                                                                                                 
     */
    size: PropTypes.oneOf(Object.keys(INPUT_SIZES)),
    /**                                                                                                                                                                                                                                       
     * The HTML input type.                                                                                                                                                                                                                   
     * @ignore                                                                                                                                                                                                                                
     */
    type: PropTypes.string,
    /**                                                                                                                                                                                                                                       
     * The input should fill the entire width of the container.                                                                                                                                                                               
     */
    fluid: PropTypes.bool,
};

Input.defaultProps = {
    size: INPUT_SIZES.md,
    type: 'text',
    fluid: true,
};

/** @component */
export default Input;

stonebk avatar Mar 30 '21 20:03 stonebk

Same issue for me

phamquocduy avatar Apr 10 '21 16:04 phamquocduy

I have the same issue, someone solves it?

linxu avatar Apr 26 '21 02:04 linxu

I had the same issue today and we were using [email protected]. Verify if you don't use the incompatible version of this package.

Miklet avatar May 26 '21 13:05 Miklet

duplicate of #590

danez avatar Apr 15 '23 09:04 danez