izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
108 stars 30 forks source link

Not compatible with Atom 0.187 #54

Closed andzaytsev closed 9 years ago

andzaytsev commented 9 years ago

The latest version of Atom doesn't work with Pdf View 0.17.0. (Atom now ships with Chrome 40.0.2214.91 and Node 1.0.0-pre).

izuzak commented 9 years ago

Works for me.

$ atom -v
0.188.0-a43333c

Just tried installing pdf-view and it installed fine and I was able to open PDFs with it.

Can you share more information about what problems your seeing? What does "not compatible" mean? Which OS are you using?

ghost commented 9 years ago

I think I'm having the same issue, I can't open any pdf file inside atom. This is the stack trace:

/home/dn/.atom/packages/pdf-view/node_modules/pdf.js/build/generic/build/pdf.js:26
PDFJS.build = 'fatal: Not a git repository (or any parent up to mount point /t
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected token ILLEGAL
  at exports.runInThisContext (vm.js:75:16)
  at Module._compile (module.js:458:25)
  at Object.loadFile [as .js] (/usr/share/atom/resources/app/src/babel.js:162:21)
  at Module.load (module.js:370:32)
  at Function.Module._load (module.js:325:12)
  at Module.require (module.js:380:17)
  at require (module.js:399:17)
  at Object.<anonymous> (/home/dn/.atom/packages/pdf-view/lib/pdf-editor-view.coffee:12:3)
  at Object.<anonymous> (/home/dn/.atom/packages/pdf-view/lib/pdf-editor-view.coffee:340:4)
  at Module._compile (module.js:475:26)

Atom 0.187.0

izuzak commented 9 years ago

@dcmst Check out https://github.com/izuzak/atom-pdf-view/issues/53 for a similar issue and how you should be able to fix things. Let me know if it doesn't help.

ghost commented 9 years ago

The solution proposed there does not make any difference on my side. I also exported the PYTHON variable since I'm on Archlinux too, but still no luck, same stack trace appears for any pdf

izuzak commented 9 years ago

Sorry, not sure why that's so. If anyone figures it out -- I'd be happy to merge a pull request which fixes things.

franciscod commented 9 years ago

same as @dcmst, also on arch. atom 0.188.0 and pdfview 0.17.0

Planeshifter commented 9 years ago

I got the same error message; what helped me was to change line 26 in the files pdf.js and pdf.worker.js by escaping the forward slashes in the PDFJS.build string, e.g. changing /home to \/home.

franciscod commented 9 years ago

Can anyone who has this working paste the PDFJS.build line from these files?

changing all these 4 from this

  25 PDFJS.version = '1.0.2';
  26 PDFJS.build = 'fatal: Not a git repository (or any parent up to mount point /home)Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
  27 ';

to this

  25 PDFJS.version = '1.0.2';
  26 PDFJS.build = 'lel';
  27 

fixed it :)

seems like the build string expand thingy uses the current git commit, but for some of us there is no git repo holding pdf.js so this fails...

https://github.com/mozilla/pdf.js/blob/master/make.js#L489

EDIT: added an issue on pdf.js: https://github.com/mozilla/pdf.js/issues/5920 and https://github.com/mozilla/pdf.js/issues/5921

they (reasonably) said that the git repo should be in place.

franciscod commented 9 years ago

it seems that for some people the git repo vanishes (or never gets created?)... ideas?

izuzak commented 9 years ago

Hey everyone. Thanks for the feedback and the help in investigating this. I just tried installing this package on OSX 10.10.3, Windows 8.1 and Ubuntu 14.04, and I didn't notice this problem. Still, I just published a new version of the package which uses a prebuilt pdf.js instead of building it itself (see https://github.com/izuzak/atom-pdf-view/issues/65). I hope that resolves the problem for everyone. If not -- please let me know.