I hope we're relatively stable these days due to the JSON API but let's
see
https://rink.hockeyapp.net/apps/0172d48cceec171249a8d850fb16276b
having on Sketch 44 with react-sketchapp/examples/basic-setup example:
> skpm build --watch --run
π¨ Copied src/manifest.json in 5ms
error Error while running the command after build
2017-05-17 02:47:24.828 coscript[19123:54336681] Exception: (null)
[NOTE: this exception originated in the server.]
[NOTE: this exception originated in the server.]
*** Object does not implement or has different method signature for selector 'hasExtension:'
β Built ./my-command.js in 1576ms
@jongold I'm also getting the same error above mentioned by @slopen.
π my bad y'all - didn't realize how quickly 44 would be released, thought I'd have more time to investigate things that break.
in any of the examples, can you try:
npm run build
npm run link-plugin
open Sketch 44, click the plugin from the Plugins menu
Does it work?
I have a feeling that the bug is in https://github.com/jongold/run-sketch-plugin (which just calls a built plugin after building) rather than react-sketchapp core (which is a relief) - working on fixing it now, let me know if running from the Plugins menu doesn't work though.
@jongold I followed the steps and the project properly rendered now - thanks! I'm on Sketch 44.
Looks like the Sketch file doesn't update when I save changes to my-command.js, is this because it's being built differently? I tried running the plugin again and it didn't update the Sketch file.
@chufucious did you run npm run build again (or npm run watch)?
npm run render basically just calls build & then runs the plugin for you - it's just that last part that's broken right now, bear with me whilst I try to fix it π
@jongold ah that worked! Thanks :)
No sweat, thanks for your hard work on this! Excited to dive in :)
@jongold I tried building another project and this is the error I get, if this is helpful:
β ~/projects/react-sketchapp/examples/profile-cards (master) npm run build
> profile-cards@ build /Users/eric/projects/react-sketchapp/examples/profile-cards
> skpm build
sh: skpm: command not found
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/Cellar/node/7.10.0/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! profile-cards@ build: `skpm build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the profile-cards@ build script 'skpm build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the profile-cards package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! skpm build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs profile-cards
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls profile-cards
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /Users/eric/.npm/_logs/2017-05-17T18_34_17_633Z-debug.log
Thanks for the quick feedback @jongold, although unfortunately running...
npm run build
npm run link-plugin
...doesn't resolve the issue for me. I still get the issue that @slopen quoted above. FYI I'm not exactly running one of your exact examples, but it was based on one of the examples as a starting point and was working well until the update to Sketch v44. Any other ideas?
Appreciate all your hard work on this!
Hi @jongold. Facing the same problem with Sketch 44.1.
The other method of building the plugin and then linking it works for me.
@Psarna94 thanks - we're working on a fix, sorry for the hiccup π
Thanks guys. can confirm build and link plugin will place it into the Plugins menu, however, still cannot run the render script. Thanks a ton of this btw.
The reason this is tricky is sketchtool run currently steals focus from your editor β you type something & save & then Sketch gets focus. It was super annoying for months. my helper in run-sketch-plugin copies what sketchtool run does, but keeps focus in your editor.
http://sketchplugins.com/d/225-what-did-sketch-44-break-in-your-code/6 that he's working on an update to sketchtool that allows you to keep focus in your editor, but it hasn't shipped yet and I don't know when it will.
A workaround until then ~= (pseudocode)
if (semver.satisfies(sketchVersion, '^43.0') {
runSketchSketchPlugin(...);
} else {
exec('sketchtool run');
}
43 will keep the current behavior^44.0 will work again, but will steal focus from the editor. I can't think of any workaround but at least it will run>= whatever-version-sketchtool-is-updated will work as desired.Thoughts on these behaviors before I make the change? cc @mathieudutour
Sounds good. Does Sketch 45 fix this?
No idea - something will fix it, I hope, and I don't think it's
reasonable of us to keep it broken indefinitely.
Yeah, I was just wondering if we could pinpoint the versions that don't work already
Still broken in Sketch 44.1 :'(
Ok so the good news is I've fixed it on Sketch 44 with https://github.com/skpm/skpm/pull/48.
You can test it out by cloning skpm locally, checking out my branch, and npm linking skpm into your local react-sketchapp project.
The bad news is everything is on fire in Sketch 45 and I have no idea how to fix it right now =/ #133
@jongold: Awesome. This is working great with 44.1! Thanks so much for this. π€ Sketchapp will respond to your concerns and allow this project to continue. There is so much great potential to it.
face the problem with 49.3
Thatβs probably not the same issue. Can you be more precise?
`
[email protected] render /Users/zhangyanan/Desktop/react-sketchapp/examples/basic-setup
skpm-build --watch --run
π¨ Copied src/manifest.json in 5ms
error Error while running the command after build
{ Error: Command failed: res=$("/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool" run "/Users/zhangyanan/Desktop/react-sketchapp/examples/basic-setup/basic-setup.sketchplugin" "main" --without-activating 2>&1); if (echo "$res" | grep "Unknown command βrunβ"); then echo "Only available on Sketch 43+"; elif (echo "$res" | grep "such file or directory"); then echo "Looks like we can't find Sketch.app.\nYou can specify where to look for it by running:\n\necho \"sketchPath: ABSOLUTE/PATH/TO/Sketch.app\" > ~/.skpmrc"; elif (true); then echo "$res"; fi
/bin/bash: -c: line 0: unexpected EOF while looking for matching `''
/bin/bash: -c: line 1: syntax error: unexpected end of file
at ChildProcess.exithandler (child_process.js:211:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:192:7)
at maybeClose (internal/child_process.js:890:16)
at Socket.<anonymous> (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:189:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
killed: false,
code: 2,
signal: null,
cmd: 'res=$("/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool" run "/Users/zhangyanan/Desktop/react-sketchapp/examples/basic-setup/basic-setup.sketchplugin" "main" --without-activating 2>&1); if (echo "$res" | grep "Unknown command βrunβ"); then echo "Only available on Sketch 43+"; elif (echo "$res" | grep "such file or directory"); then echo "Looks like we can\'t find Sketch.app.\nYou can specify where to look for it by running:\n\necho \"sketchPath: ABSOLUTE/PATH/TO/Sketch.app\" > ~/.skpmrc"; elif (true); then echo "$res"; fi' }
π¨ Built ./my-command.js in 2393ms
`
I follow the quickstart part ,after the command 'npm run render', it gives the error
Most helpful comment
having on Sketch 44 with react-sketchapp/examples/basic-setup example: