react-sketchapp icon indicating copy to clipboard operation
react-sketchapp copied to clipboard

Doesn't work on El Capitan and lower

Open barberry88 opened this issue 9 years ago • 18 comments

I m beginner, i tried to install but when I open the basic-setup plugin file, nothing is shown, just blank. (I see plugin is successfully installed on Sketch on Plugin tab)
Reporting a bug or issue
------------------------------------------------------------------------------------------------
After npm install

-> [email protected] install /Users/bhur/react-sketchapp/examples/basic-setup/node_modules/fsevents

node install

[fsevents] Success: "/Users/bhur/react-sketchapp/examples/basic-setup/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile

[email protected] postinstall /Users/bhur/react-sketchapp/examples/basic-setup/node_modules/webpack/node_modules/uglifyjs-webpack-plugin node lib/post_install.js

[email protected] postinstall /Users/bhur/react-sketchapp/examples/basic-setup npm run build && skpm-link

[email protected] build /Users/bhur/react-sketchapp/examples/basic-setup skpm-build

[1/2] 🖨 Copied src/manifest.json in 10ms [2/2] ⚒ Built ./my-command.js in 963ms success Plugin built [1/1] 🔗 Symlinking the plugin basic-setup... success Plugin basic-setup symlinked basic-setup - 1.0.0

warning Starting with Sketch 45, you need to restart Sketch for your plugin to appear in the "plugins" menu

npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN [email protected] No repository field.

After npm run render,

[email protected] render /Users/bhur/react-sketchapp/examples/basic-setup skpm-build --watch --run

🖨 Copied src/manifest.json in 12ms SyntaxError: Unexpected identifier 'j'. Expected either 'in' or 'of' in enumeration syntax.. Plugin “react-sketchapp: Basic Setup”, line 7314: » for (let j = 0; j < object.count(); j += 1) { ⛏ Built ./my-command.js in 4627ms

Sketch version: 47

barberry88 avatar Nov 29 '17 19:11 barberry88

What operating system are you on?

jem-computer avatar Nov 29 '17 19:11 jem-computer

OS X El Capitan .Ver 10.11.6

barberry88 avatar Nov 29 '17 20:11 barberry88

+1

RylanH avatar Dec 02 '17 07:12 RylanH

I'm having the same issue, it works fine on my mac with Sierra, but with my other mac that runs El Capitan it throws the same error.

SyntaxError: Unexpected identifier 'j'. Expected either 'in' or 'of' in enumeration syntax..
Plugin “yaardvark-core: Render”, line 7287:
»   for (let j = 0; j < object.count(); j += 1) {

kirkbrauer avatar Dec 05 '17 02:12 kirkbrauer

+1 HighSierra SketchApp 48.1

saiqulhaq avatar Dec 19 '17 12:12 saiqulhaq

I'm getting

TypeError: MSAttributedString.alloc().initWithAttributedString is not a function. (In 'MSAttributedString.alloc().initWithAttributedString(attribStr)', 'MSAttributedString.alloc().initWithAttributedString' is undefined)
line: 2957

Running High Sierra 10.13.1, Sketch 48.1

maartenschumacher avatar Dec 20 '17 10:12 maartenschumacher

Wait nevermind, this is a different issue. @saiqulhaq see https://github.com/airbnb/react-sketchapp/issues/213#issuecomment-350017757, it doesn't work with Sketch 48

maartenschumacher avatar Dec 20 '17 10:12 maartenschumacher

@maartenschumacher ok thanks, I will try

saiqulhaq avatar Dec 20 '17 10:12 saiqulhaq

it does work with Sketch48, see https://github.com/airbnb/react-sketchapp/issues/225

This is issue is about El Capitan and lower

mathieudutour avatar Dec 20 '17 10:12 mathieudutour

Hi - getting the same issue - also on El Cap - any ETA on this?

clouditinerary avatar Dec 25 '17 13:12 clouditinerary

I follow the instructions and get so far:

Copied src/manifest.json in 12ms SyntaxError: Unexpected identifier 'j'. Expected either 'in' or 'of' in enumeration syntax.. Plugin “my-command”, line 8430: » for (let j = 0; j < object.count(); j += 1) { ⛏ Built ./my-command.js in 2218ms

And then nothing.

node 9.3.0 npm 5.6.0 Sketch 48.1 OSX 10.11.6

I'm stumped.

dewexdewex avatar Dec 29 '17 00:12 dewexdewex

I'm also getting an error

➜  basic-setup git:(master) npm run render

> [email protected] render /Users/dwicao/Documents/sketch/react-sketchapp/examples/basic-setup
> skpm-build --watch --run

🖨  Copied src/manifest.json in 13ms
SyntaxError: Unexpected identifier 'original'.
Plugin “my-command”, line 26854:
»     let original = prototype[name];
🔩  Built ./my-command.js in 3011ms

node 8.9.1 npm 5.5.1 Sketch 48.2 OSX 10.11.6

Any workaround?

dwicao avatar Jan 23 '18 04:01 dwicao

I'm getting this same error as well. Any updates ? Sketch 49 OSX 10.11.6

benjamingeorge avatar Feb 28 '18 22:02 benjamingeorge

workaround: update your macOS

mathieudutour avatar Mar 13 '18 06:03 mathieudutour

Does that workaround post mean this is a wontfix?

LiveMethod avatar Mar 23 '18 05:03 LiveMethod

I traced this to the [email protected] library, which uses let, which the version of WebKit that Sketch has on 10.11 doesn’t like.

A quick check seemed to show that yoga-layout 1.9 is correctly restricted to ES2015 ES5 and probably would prevent this from happening.

I’m also looking into whether it’s feasible to hack the webpack config to run Babel on the yoga-layout package.

Edit: Mis-spoke and said "ES2015" when what I meant was "ES5".

fionawhim avatar Apr 28 '18 23:04 fionawhim

Couldn’t we make a PR to that package and lower its language support? “Restricted to ES2015” isn’t what I’d call “correct”; the ecosystem convention in JS is ES5 CJS.

ljharb avatar Apr 29 '18 00:04 ljharb

Sorry, I meant ES5. Updated my comment above.

FWIW I got this running locally by adding the following webpack.skpm.config.js file to my plugin’s root:

module.exports = function (config, isPluginCommand) {
  config.module.rules[0].exclude = /node_modules\/(?!(yoga-layout\/sources))/
  return config;
}

Note: This only works if yoga-layout was installed just inside node_modules, which is what npm will probably do, if you haven’t messed around and installed competing versions of it.

fionawhim avatar Apr 29 '18 01:04 fionawhim