Glavin001 / atom-preview

:construction: (NO LONGER MAINTAINED) :construction: - :eyeglasses: Ultimate previewer of source code in Atom.
https://atom.io/packages/preview
MIT License
51 stars 23 forks source link

coffee + yield not working #120

Closed davibe closed 8 years ago

davibe commented 8 years ago

I get "error: reserved word yield" when previewing

dancasey commented 8 years ago

After poking around this for a couple minutes:

Necromos commented 8 years ago

I will shortly post tmp workaround for this.

Glavin001 commented 8 years ago

I believe atom's version of coffee-script overrides atom-preview's version, which would mean the problem is upstream... but I could be wrong

Whoa. This would be extremely strange behaviour. Has this been confirmed?

Great work on your poking around though @dancasey !

dancasey commented 8 years ago

I did not try @Necromos solution, but there is an easier way: update this package's package.json to at least "coffee-script": "^1.9.0". Here's what I did to test this:

This works (no error with yield keyword), which I guess means that the way apm resolves packages is that saying ^1.7.1 means atom's version 1.8.0 sufficies (because ^ is at least this minor version, but same major version). When you put ^1.9.3 however, it then overrides 1.8.0.

Here's where I got this idea: looking at similar package source-preview, I saw that yield keyword works, it does not seem to do funny business with require, and it depends on coffee-script ^1.9.3.

Hope this helps.