Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on El Capitan and lower #210

Closed
barberry88 opened this issue Nov 29, 2017 · 18 comments · Fixed by #314
Closed

Doesn't work on El Capitan and lower #210

barberry88 opened this issue Nov 29, 2017 · 18 comments · Fixed by #314
Labels

Comments

@barberry88
Copy link

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

-> fsevents@1.1.3 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

uglifyjs-webpack-plugin@0.4.6 postinstall /Users/bhur/react-sketchapp/examples/basic-setup/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
node lib/post_install.js

basic-setup@1.0.0 postinstall /Users/bhur/react-sketchapp/examples/basic-setup
npm run build && skpm-link

basic-setup@1.0.0 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 basic-setup@1.0.0 No repository field.

After npm run render,

basic-setup@1.0.0 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

@jemgold
Copy link
Contributor

jemgold commented Nov 29, 2017 via email

@barberry88
Copy link
Author

barberry88 commented Nov 29, 2017 via email

@RylanH
Copy link

RylanH commented Dec 2, 2017

+1

@kirkbrauer
Copy link

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) {

@saiqulhaq
Copy link

+1 HighSierra
SketchApp 48.1

@maartenschumacher
Copy link

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
Copy link

Wait nevermind, this is a different issue. @saiqulhaq see #213 (comment), it doesn't work with Sketch 48

@saiqulhaq
Copy link

@maartenschumacher ok thanks, I will try

@mathieudutour
Copy link
Collaborator

it does work with Sketch48, see #225

This is issue is about El Capitan and lower

@mathieudutour mathieudutour changed the title When open Sketch Plugin file, nothing shows Doesn't work on El Capitan and lower Dec 20, 2017
@clouditinerary
Copy link

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

@dewexdewex
Copy link

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.

@dwicao
Copy link

dwicao commented Jan 23, 2018

I'm also getting an error

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

> basic-setup@1.0.0 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?

@benjamingeorge
Copy link

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

@mathieudutour
Copy link
Collaborator

workaround: update your macOS

@LiveMethod
Copy link

Does that workaround post mean this is a wontfix?

@fionawhim
Copy link

fionawhim commented Apr 28, 2018

I traced this to the yoga-layout@1.8.0 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".

@ljharb

This comment has been minimized.

@fionawhim
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.