allefeld / atom-pdfjs-viewer

Themed, fully featured PDF viewer for the Atom editor
MIT License
12 stars 3 forks source link

Error on Mac #5

Closed jano23 closed 3 years ago

jano23 commented 4 years ago

I am getting the following error when I double click on a pdf file:

Error compiling Less stylesheet: /Users//.atom/packages/pdfjs-viewer/pdfjs/web/viewer.less

Line number: 604 .scrollbars-visible-always is undefined

allefeld commented 4 years ago

I'm afraid I have no idea why this wouldn't work on a Mac. Could you post the output of atom --version?

jano23 commented 4 years ago

Atom : 1.48.0 Electron: 5.0.13 Chrome : 73.0.3683.121 Node : 12.0.0

allefeld commented 4 years ago

Thanks. I've asked people on discuss.atom.io for help, let's see whether someone knows what might be the cause: https://discuss.atom.io/t/scrollbars-visible-always-is-undefined/75688

allefeld commented 4 years ago

Nothing from discuss.atom.io, let's try stackoverflow: https://stackoverflow.com/questions/63178153/mixin-scrollbars-visible-always-undefined-in-atom-on-mac-ignore-less-mixi

allefeld commented 4 years ago

Nothing on stackoverflow either.

Could you open /Users//.atom/packages/pdfjs-viewer/pdfjs/web/viewer.less and delete line 604, which should contain .scrollbars-visible-always();? After that you need to restart Atom.

Sorry this is taking so long.

allefeld commented 3 years ago

Can you try my suggestion?

jano23 commented 3 years ago

That worked!!

jano23 commented 3 years ago

It does take about 8 seconds before the pdf appears

allefeld commented 3 years ago

That worked!!

Great! I'll try to figure out how to disable that line of the LESS code specifically on Macs.

allefeld commented 3 years ago

It does take about 8 seconds before the pdf appears

I'm afraid I have no way of influencing that. For my own PDFs of a a few dozen pages it is pretty fast, but there are limits to a PDF implementation in JavaScript. If it bothers you, I recommend submitting an issue on the PDF.js repository.

jano23 commented 3 years ago

It doesn't really bother me. I just wait for a bit. But I'll remember your suggestion

On Tue, Feb 2, 2021 at 7:23 AM Carsten Allefeld notifications@github.com wrote:

It does take about 8 seconds before the pdf appears

I'm afraid I have no way of influencing that. For my own PDFs of a a few dozen pages its pretty fast, but there are limits to a PDF implementation in JavaScript. If it bothers you, I'd recommend submitting an issue on the PDF.js repository https://github.com/mozilla/pdf.js.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/allefeld/atom-pdfjs-viewer/issues/5#issuecomment-771630905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFZJ34XOAOO7KGOGAD2OZDS474DTANCNFSM4N5ZI3RA .

ygoltrant commented 3 years ago

Hi ! Just for you to know, the problems also appeared on ubuntu 20.10 with Atom (1.56.0) via snap. I did what you suggested and it worked (commented out with // line 604). But my point is that Mac might not be the problem (I never used mac ^^')…

allefeld commented 3 years ago

Thanks! I guess I should just get rid of .scrollbars-visible-always.

ygoltrant commented 3 years ago

Well I can't say. I mean it works pretty well without it, so it does not seem vital. Maybe at least there could be a warning in the "Installation" section about it. Anyway, thanks a lot for your responsiveness :)

allefeld commented 3 years ago

After quite a delay (sorry), I removed .scrollbars-visible-always because of another related issue #16.

It's possible that this was indeed never a Mac problem, but had to do with the atom.less file of a specific UI theme. This file is no longer imported, but a small attempt to match the scrollbar to the UI theme is made instead. See c654b0b6da090724a48f0b51feb0e330b41e48ea.