airbnb / react-sketchapp

render React components to Sketch ⚛️💎
http://airbnb.io/react-sketchapp/
MIT License
14.94k stars 820 forks source link

Building 'symbols' example after changes fails when browsing Symbols page in Sketch #441

Closed maciej-gurban closed 11 months ago

maciej-gurban commented 5 years ago

I am...

Reporting a bug or issue Making code changes while on Symbols page breaks the build

Expected behavior: Making changes to the code would reflect them in Sketch regardless of which page is being browsed, as is the case with all the other examples.

How to reproduce:

  1. Go to symbols example and run it using npm run render. This renders "Page 1" correctly
  2. Switch page from "Page 1" to "Symbols" in Sketch
  3. Make any code change to the component file(s) while on "Symbols" page and save the file
  4. Causes a build error, from which one cannot recover unless going back to "Page 1". The error:
    Error: Cannot render into Symbols page
    at render (/Users/XXX/sketchapp/react-sketchapp/examples/symbols/symbols.sketchplugin/Contents/Sketch/my-command.js:4010:16)
    at /Users/XXX/sketchapp/react-sketchapp/examples/symbols/symbols.sketchplugin/Contents/Sketch/my-command.js:8600:30
    at __skpm_run (/Users/XXX/sketchapp/react-sketchapp/examples/symbols/symbols.sketchplugin/Contents/Sketch/my-command.js:50505:17)
    at __skpm_run[native code] (/)

Sketch version: Version 58 (84663)

mathieudutour commented 5 years ago

The error is pretty clear: you can't execute the plugin while on the Symbols page.