Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imports property seems to have stopped working as intended, could you confirm? #249

Open
renandf opened this issue Feb 24, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@renandf
Copy link

renandf commented Feb 24, 2025

TL;DR

imports doesn't seem to override the import statements anymore, and it's simply added together with the other import statements.

Context

A few weeks ago I connected some components between Figma and our design system via Code Connect. I've used imports to override the import statement as mentioned on issue #16, and it was working fine until recently. For example, I had the following code:

figma.connect(BcButton, '<FIGMA_BUTTONS>', {
  imports: ["import { BcButton, BcIcons } from '@bugcrowd/bc-elements'"],
  variant: {...},
  props: ...,
  example (...) => (...)
})

As expected, inside Code Connect, the only import statement present was:

import { BcButton, BcIcons } from '@bugcrowd/bc-elements'

However, last week I noticed all components were now showing multiple import statements. It seems the property used inside imports is simply being added to the list instead of overriding all of them.

Examples

Here are a couple of examples containing the example section in code and the Code Connect in Dev Mode.

Button example

The Button was working fine and I haven't touched it in the past few days. I published all Code Connect components when I was adding a new one (Modal below), and then realised the "imports issue." When I checked the button and all other components, they had the same issue.

Image Image
Modal example

This was the "new" component that made me realise the issue. When I published it using npx figma connect publish, which published all other components with it, I noticed the unwanted import statements. I went to check the other ones, and all of them had the same issue.

Image Image

Bug or intended behaviour?

Am I right in assuming this is not the intended behaviour and it's likely a bug? If it is a bug, can someone else see it too on their side, or should I raise a support ticket to investigate my case individually?

I don't know exactly when the issue started. I realised when testing the new component, but it could be there beforehand.

Important

It was working fine in all (4~6) components before. The issue started after I published everything together, and even those components that were working and I didn't touch, got the issue


  • Code Connect CLI version: 1.3.1
  • Operating system: macOS Sequoia 15.3.1
@slees-figma slees-figma added bug Something isn't working and removed API question labels Feb 25, 2025
@slees-figma
Copy link

Hey @renandf! Thanks for the report, this is a longstanding bug around imports for nested instances that we shipped a fix for a few weeks ago which we had to revert, likely when you started seeing the issue. We are tracking this issue and hope to have proper fix for it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants