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

React/TypeScript - Connecting components to Zeplin components failed.

Open DigiDigiblez opened this issue 4 years ago • 4 comments

Seems like I am having issues with ES6 imports, or TypeScript itself?

import React from "react";
import cls from "classnames";
import { IButtonProps } from "./types";
import "./Button.scss";

const baseclass = "button";

const Button = ({
    ...,
}: IButtonProps) => {
    const classes = cls(
        baseclass,
        className,
       ...,
    );

    return (
        <button
            disabled={disabled}
            className={classes}
            type={type}
            onClick={onClick}>
            {children}
        </button>
    );
};

export default Button;

Results in following output issue:

Connecting components to Zeplin components failed.

    Error occurred while processing src/components/atoms/Button/Button.tsx with @zeplin/cli-connect-react-plugin:

    /Users/carlbowen/WebstormProjects/note/node_modules/@zeplin/cli-connect-react-plugin/dist/template/base.pug:18
        16| 
        17| mixin propType(name, propType)
      > 18|     if propType.name === "union"
        19|         |   #{name}={union[
        20|         +propertyValues(propType.value)
        21|         | }]

    Cannot read property 'name' of undefined

My config file is as follows:

{
	"plugins": [
		{
			"name": "@zeplin/cli-connect-react-plugin"
		}
	],
	"projects": [],
	"styleguides": [
		"5cd486b18a..."
	],
	"components": [
		{
			"path": "src/components/atoms/Button/Button.tsx",
			"zeplinNames": [
				"Full Logo"
			]
		}
	]
}

API versions in use:

"@zeplin/cli": "^1.0.0",
"@zeplin/cli-connect-react-plugin": "^0.2.3",

DigiDigiblez avatar Mar 07 '20 20:03 DigiDigiblez

I am also having the same issue.

- @zeplin/[email protected]
 - @zeplin/[email protected]
 - @zeplin/[email protected]

blancomario avatar Mar 13 '20 20:03 blancomario

Have you guys found any way out of this? Or what exactly is causing the issue?

jacobdo2 avatar Mar 17 '20 11:03 jacobdo2

@jacobdo2 not yet sadly. Wish we could prioritise this ticket.

DigiDigiblez avatar Mar 23 '20 10:03 DigiDigiblez

This may have been resolved today in @zeplin/[email protected]

alphanumericone avatar May 11 '20 22:05 alphanumericone