[Bug] Support component variants in Figma
matwii opened this issue · comments
Hey I've experienced some errors when I try to add an URL to a component that has component variants in Figma like the image below:
Whenever I copy the link I just get an error in the wrapper in storybook.
If I try to add a link to a component within a frame or a single component without variants, it works completely fine.
@matwii Can you share the error you got? I don't know much about Figma Components/Variants, but it seems it requires extra care when dealing with components or variants.
@pocka this is the error that occurs:
And here are responses for both api calls done via figspec in a component using variants:
https://gist.github.com/yannbf/80f9f06716d76f6feccb7d6d0f8a5f57
The crash is related to a new node type introduced: "COMPONENT_SET", which is not expected in the codebase. I have a potential fix at #23
Just released @figspec/components@v0.1.7
, which adds support for component variants. Could you test it and see if it fixed the problem?
Hey @pocka I tried it out in my personal project and it worked fine! The trouble I had was that @figspec/react
depends on @figspec/components@^0.1.1
and for some reason it was resolving to 0.1.6, so I had two versions in my repo, and the one taking precedence was 0.1.6. I had to use yarn resolutions to see the updated code 🤔 Hopefully won't happen to @matwii, but I guess we should update the deps of fispec/react.
Probably locked by a lockfile? This seems the most straightforward solution... I'm disappointed Yarn still does not have a way to upgrade transitive dependencies.
Probably locked by a lockfile? This seems the most straightforward solution... I'm disappointed Yarn still does not have a way to upgrade transitive dependencies.
You're most definitely right. I'm doing quite a few things at the same time, didn't think of removing the yarn lock file to try it out! It worked fine after doing so :))
Worked perfectly thanks! Sorry for the late answer.