gridaco / assistant

🤖 Bring your Figma design & development pipeline to the next level - with design to code, in-design-content-management, component management, tools for faster design
https://grida.co/assistant
Other
578 stars 47 forks source link

fix: not generating code when component or instance is selected #122

Open jjangga0214 opened 3 years ago

jjangga0214 commented 3 years ago

Describe the bug Grida does not generate code when component or instance is selected.

To Reproduce:

  1. Copy https://www.figmacrush.com/tasker-todo-app-figma/
  2. Go to "Other Components" Page
  3. Execute Grida Assistant Figma Plugin against figma component or instance

Screenshot(s): Screenshot from 2021-08-07 15-38-53

Info:

softmarshmallow commented 3 years ago

Hi. thanks for the report. Can you copy logs on your console?

jjangga0214 commented 3 years ago

@softmarshmallow

Console was cleared. figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br:1641:14104
------- Clearing and silencing console.log from Figma ------- figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br:39:501
registering custom app event handler for key: data-mapper-custom-transport. figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br:39:501
unreachable code after return statement
data:PHNjcmlwdD4KICBvbm1lc3NhZ2UgPSAoZXZlbnQpID0+IHsKICAgIGlmIChldmVudC5zb3VyY2UgPT09IHBhcmVudC5wYXJ:203376:20
Attempt to set a forbidden header was denied: origin 2 data:PHNjcmlwdD4KICBvbm1lc3NhZ2UgPSAoZXZlbnQpID0+IHsKICAgIGlmIChldmVudC5zb3VyY2UgPT09IHBhcmVudC5wYXJ:29445:18
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cors.bridged.cc/https://analytics.internal.bridged.cc/analytics/event?token=646419. (Reason: CORS request did not succeed).

[IGNORE] non critical error occured while performing analytics event emition. you can silent this warning by setting `warning: false` Error: Network Error
    createError data:text/html;base64,PHNjcmlwdD4KICBvbm1lc3NhZ2UgPSAoZXZlbnQpID0+IHsKICAgIGlmIChldmVudC5zb3VyY2UgPT09IHBhcmVudC5wYXJlbnQgJiYgZXZlbnQub3JpZ2luID09PSAiaHR0cHM6Ly93d3cuZmlnbWEuY29tIikgewogICAgICBkb2N1bWVudC53cml0ZSgiPHNjcmlwdD4iICsgIlxuZG9jdW1lbnQuY2xvc2UoKTtcbmRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2tleWRvd24nLCAoZSkgPT4ge1xuICBpZiAoZS5rZXlDb2RlID09PSA4MCAvKiBQICovICYmICFlLnNoaWZ0S2V5ICYmIGUuYWx0S2V5ICYmIGUuY3RybEtleSAmJiAhZS5tZXRhS2V5KSB7XG4gICAgLy8gSGFuZGxlIHRoZSBwbHVnaW4gcmUtcnVuIHNob3J0Y3V0XG4gICAgcGFyZW50LnBvc3RNZXNzYWdlKCckSU5URVJOQUxfRE9fTk9UX1VTRSRSRVJVTl9QTFVHSU4kJywgJyonKVxuICAgIGUuc3RvcFByb3BhZ2F0aW9uKClcbiAgICBlLnN0b3BJbW1lZGlhdGVQcm9wYWdhdGlvbigpXG4gIH0gZWxzZSBpZiAoZmFsc2UpIHtcbiAgICAvLyBIYW5kbGUgU2VsZWN0IEFsbCwgVW5kbyBhbmQgUmVkbyBpbiB0aGUgZGVza3RvcCBhcHBcbiAgICBpZiAoZS5rZXlDb2RlID09PSA2NSAvKiBBICovICYmIGUuY3RybEtleSkge1xuICAgICAgZG9jdW1lbnQuZXhlY0NvbW1hbmQoJ3NlbGVjdEFsbCcpXG4gICAgfSBlbHNlIGlmIChlLmtleUNvZGUgPT09IDkwIC8qIFogKi8gJiYgZS5jdHJsS2V5KSB7XG4gICAgICBpZiAoZS5zaGlmdEtleSkge1xuICAgICAgICBkb2N1bWVudC5leGVjQ29tbWFuZCgncmVkbycpXG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkb2N1bWVudC5leGVjQ29tbWFuZCgndW5kbycpXG4gICAgICB9XG4gICAgfVxuICB9XG59LCB0cnVlKVxuIiArICI8LyIgKyAic2NyaXB0PiIgKyBldmVudC5kYXRhKQogICAgfQogIH0KPC9zY3JpcHQ+ line 4 > injectedScript:29522
    handleError data:text/html;base64,PHNjcmlwdD4KICBvbm1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AgfVxuICB9XG59LCB0cnVlKVxuIiArICI8LyIgKyAic2NyaXB0PiIgKyBldmVudC5kYXRhKQogICAgfQogIH0KPC9zY3JpcHQ+ line 4 > injectedScript:29404
data:PHNjcmlwdD4KICBvbm1lc3NhZ2UgPSAoZXZlbnQpID0+IHsKICAgIGlmIChldmVudC5zb3VyY2UgPT09IHBhcmVudC5wYXJ:65843:21
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cors.bridged.cc/https://analytics.internal.bridged.cc/analytics/event?token=646419. (Reason: CORS request did not succeed).

[IGNORE] non critical error occured while performing analytics event emition. you can silent this warning by setting `warning: false` Error: Network Error
    createError data:text/html;base64,PHNjcmlwdD4KICBvbm1lc3NhZ2UgPSAoZXZlbnQpID0+IHsKICAgIGlmIChldmVudC5zb3VyY2UgPT09IHBhcmVudC5wYXJlbnQgJiYgZXZlbnQub3JpZ2luID09PSAiaHR0cHM6Ly93d3cuZmlnbWEuY29tIikgewogICAgICBkb2N1bWVudC53cml0ZSgiPHNjcmlwdD4iICsgIlxuZG9jdW1lbnQuY2xvc2UoKTtcbmRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2tleWRvd24nLCAoZSkgPT4ge1xuICBpZiAoZS5rZXlDb2RlID09PSA4MCAvKiBQICovICYmICFlLnNoaWZ0S2V5ICYmIGUuYWx0S2V5ICYmIGUuY3RybEtleSAmJiAhZS5tZXRhS2V5KSB7XG4gICAgLy8gSGFuZGxlIHRoZSBwbHVnaW4gcmUtcnVuIHNob3J0Y3V0XG4gICAgcGFyZW50LnBvc3RNZXNzYWdlKCckSU5URVJOQUxfRE9fTk9UX1VTRSRSRVJVTl9QTFVHSU4kJywgJyonKVxuICAgIGUuc3RvcFByb3BhZ2F0aW9uKClcbiAgICBlLnN0b3BJbW1lZGlhdGVQcm9wYWdhdGlvbigpXG4gIH0gZWxzZSBpZiAoZmFsc2UpIHtcbiAgICAvLyBIYW5kbGUgU2VsZWN0IEFsbCwgVW5kbyBhbmQgUmVkbyBpbiB0aGUgZGVza3RvcCBhcHBcbiAgICBpZiAoZS5rZXlDb2RlID09PSA2NSAvKiBBICovICYmIGUuY3RybEtleSkge1xuICAgICAgZG9jdW1lbnQuZXhlY0NvbW1hbmQoJ3NlbGVjdEFsbCcpXG4gICAgfSBlbHNlIGlmIChlLmtleUNvZGUgPT09IDkwIC8qIFogKi8gJiYgZS5jdHJsS2V5KSB7XG4gICAgICBpZiAoZS5zaGlmdEtleSkge1xuICAgICAgICBkb2N1bWVudC5leGVjQ29tbWFuZCgncmVkbycpXG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkb2N1bWVudC5leGVjQ29tbWFuZCgndW5kbycpXG4gICAgICB9XG4gICAgfVxuICB9XG59LCB0cnVlKVxuIiArICI8LyIgKyAic2NyaXB0PiIgKyBldmVudC5kYXRhKQogICAgfQogIH0KPC9zY3JpcHQ+ line 4 > injectedScript:29522
    handleError data:text/html;base64,PHNjcmlwdD4KICBvbm1lc3NhZ2UgPSAoZXZlbnQpID0+IHsKICAgIGlmIChldmVudC5zb3VyY2UgPT09IHBhcmVudC5wYXJlbnQgJiYgZXZlbnQub3JpZ2luID09PSAiaHR0cHM6Ly93d3cuZmlnbWEuY29tIikgewogICAgICBkb2N1bWVudC53cml0ZSgiPHNjcmlwdD4iICsgIlxuZG9jdW1lbnQuY2xvc2UoKTtcbmRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2tleWRvd24nLCAoZSkgPT4ge1xuICBpZiAoZS5rZXlDb2RlID09PSA4MCAvKiBQICovICYmICFlLnNoaWZ0S2V5ICYmIGUuYWx0S2V5ICYmIGUuY3RybEtleSAmJiAhZS5tZXRhS2V5KSB7XG4gICAgLy8gSGFuZGxlIHRoZSBwbHVnaW4gcmUtcnVuIHNob3J0Y3V0XG4gICAgcGFyZW50LnBvc3RNZXNzYWdlKCckSU5URVJOQUxfRE9fTk9UX1VTRSRSRVJVTl9QTFVHSU4kJywgJyonKVxuICAgIGUuc3RvcFByb3BhZ2F0aW9uKClcbiAgICBlLnN0b3BJbW1lZGlhdGVQcm9wYWdhdGlvbigpXG4gIH0gZWxzZSBpZiAoZmFsc2UpIHtcbiAgICAvLyBIYW5kbGUgU2VsZWN0IEFsbCwgVW5kbyBhbmQgUmVkbyBpbiB0aGUgZGVza3RvcCBhcHBcbiAgICBpZiAoZS5rZXlDb2RlID09PSA2NSAvKiBBICovICYmIGUuY3RybEtleSkge1xuICAgICAgZG9jdW1lbnQuZXhlY0NvbW1hbmQoJ3NlbGVjdEFsbCcpXG4gICAgfSBlbHNlIGlmIChlLmtleUNvZGUgPT09IDkwIC8qIFogKi8gJiYgZS5jdHJsS2V5KSB7XG4gICAgICBpZiAoZS5zaGlmdEtleSkge1xuICAgICAgICBkb2N1bWVudC5leGVjQ29tbWFuZCgncmVkbycpXG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkb2N1bWVudC5leGVjQ29tbWFuZCgndW5kbycpXG4gICAgICB9XG4gICAgfVxuICB9XG59LCB0cnVlKVxuIiArICI8LyIgKyAic2NyaXB0PiIgKyBldmVudC5kYXRhKQogICAgfQogIH0KPC9zY3JpcHQ+ line 4 > injectedScript:29404
data:PHNjcmlwdD4KICBvbm1lc3NhZ2UgPSAoZXZlbnQpID0+IHsKICAgIGlmIChldmVudC5zb3VyY2UgPT09IHBhcmVudC5wYXJ:65843:21
thread#code: syncing target platform to com.figma.Desktop figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br:39:501
Source map error: Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Resource URL: https://www.figma.com/figbuild-artifacts/figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br
Source Map URL: https://admin.figma.com/admin/figbuild-artifacts/figma_app.f586e6d9e028988bd1482e71537bb28b.min.js.map
softmarshmallow commented 3 years ago

Is it the log printing when you click that specific node? I cannot see any node selection related information. isntit log comming from when you open the plugin?

jjangga0214 commented 3 years ago

@softmarshmallow You're right.

Console was cleared. figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br:842:1212
log cleared. optimized for new build figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br:39:501
selection 
Array [ {…} ]
figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br:39:501
TypeError: cannot read property 'Normal' of undefined
    at convertBlendModeToReflect (PLUGIN_3_SOURCE:22190)
    at convertBlend (PLUGIN_3_SOURCE:21834)
    at convertDefaultShape (PLUGIN_3_SOURCE:21842)
    at <anonymous> (PLUGIN_3_SOURCE:21751)
    at map (native)
    at intoReflectNodes (PLUGIN_3_SOURCE:21781)
    at convertFrameNodeToAlt (PLUGIN_3_SOURCE:21912)
    at <anonymous> (PLUGIN_3_SOURCE:21711)
    at map (native)
    at intoReflectNodes (PLUGIN_3_SOURCE:21781)
    at intoReflectNode (PLUGIN_3_SOURCE:21641)
    at <anonymous> (PLUGIN_3_SOURCE:25996)
figma_app.8448f4dbbc30112eace0c67de584d7b2.min.js.br:39:501
softmarshmallow commented 3 years ago

It's a issue that we have and it will take at least 2 days to fix this. Until then, you can try to reset blend mode of your selecttions' + & children to have no special layer blending effects

ping- issue occurring while node conversion : https://github.com/gridaco/design-sdk