Closed gossi closed 5 months ago
let me see if i can't repro. thanks for reporting.
I am unable to reproduce and can successfully see code snippets for published library components. Is it possible you didn't update the library in the second file?
The fact that this says "error" in the title is a little confusing to me, unsure how that can happen at a code level. Does a red message pop up in Figma / are there errors in the JS console?
EDIT: I suppose another scenario would be if you added the template to the instance instead of the main component. You can add a template to any node, including an instance. If you want to have it stored in the library itself, you want to make sure youre adding the template to the main component / component set, not the instance.
Able to repro the "error" state, but by doing something else entirely. Looking into this now!
I believe this occurs when what was saved to plugin data wasnt a valid CodegenResult[]
template array. I am going to write a guard on that.
can confirm that this is actually my generic guard whenever an error happens. going to add a line that logs errors in the console/code so that we can debug.
can you try and repro and see what shows up in the code panel now? commit: https://github.com/figma/code-snippet-editor-plugin/commit/37fa6adbc557e1ef9d9bb6bc3cf65d236518a069 should yield more information in the code snippet area now.
It shows the code again in the inspect panel. Thanks a lot.
Here is a screenshot of the console from Figma. But its also a series of logs I see (like double entries).
I opened both:
Here is the code snippet definition for that component:
PS. What I was seeing (didn't take a screenshot here). When inspecting the component, then it showed in a green alert, that something with regards to the code snippet was updated and I either x'ed it away or said ok.
Ok so I am hearing that it sounds like this is resolved? If so I'll close this issue.
Two things:
<Lal @foo={{t ".." }}/>
isn't escaped, so I tested it escaped, <Lal @foo=\{{t ".." }}/>
and it's still not rendering. I am going to create a new bug for that and try and get to the bottom of it.Awesome, great job! Thanks a lot
I'm running into an issue and this might be because I'm using this plugin wrong and then this is a question to use it correctly - or - if I'm using the plugin correctly, then I likely found a bug.
What I see:
Repro Steps:
A) In my components file:
B) I another file:
Expectation:
I would see the code in my other file as I'd seen this for the instances I tested them with in the same file.