manuels / texlive.js

Compiling LaTeX (TeX live) in your browser
http://manuels.github.com/texlive.js/
GNU General Public License v2.0
1.25k stars 140 forks source link

How to get this to work with Microsoft IIS (express)? #42

Open zwaq opened 7 years ago

zwaq commented 7 years ago

Hi,

title pretty much says it all. I cloned the repo and I cannot get the index.html to work. Apparently its pretty normal for it not to work from the filesystem, so I put it in an IIS Express, but I still run into an error everytime, even with the minimum example:

var pdftex = new PDFTeX(); var latex_code = "" + "\documentclass{article}" + "\begin{document}" + "\LaTeX is great!" + "$E = mc^2$" + "\end{document}"; pdftex.compile(latex_code).then(function() { console.log("asd"); })

I get:

Promise {_callbacks: Array[0]}_callbacks: Array[0]proto: Object pdftex-worker.js:1480 Uncaught Error: No such file or directory

lookup @ pdftex-worker.js:1480 lookup @ pdftex-worker.js:1509 Z @ pdftex-worker.js:1502 B @ pdftex-worker.js:1500 X @ pdftex-worker.js:1509 create @ pdftex-worker.js:1510 nd @ pdftex-worker.js:1530 nc @ pdftex-worker.js:1536 k.onload @ pdftex-worker.js:2 aa @ pdftex-worker.js:2 self.onmessage @ pdftex-worker.js:4

I noticed that clicking the button on the github.io site, over 100 network requests are made, while my local iis site only does like 26 and then throws the error. I configured my iis to serve all filetypes from the .lst files and it does serve them. It seems to be an issue with the virtual filesystem not creating anything. Im totally lost on how to continue debugging. I feel like the server settings actually should not interfere in javascripts execution too much, but I cannot think of any other error. I tried to compile it myself on a xenial ubuntu with --minify 0, but it gets stuck somewhere on the way (Im not great at compiling stuff), so I also dont have an unminified version of the worker. Anyway, I feel like this might actually be easy to fix with some experience (which I dont have a lot of sadly), so I figured Id just ask here. Maybe its just a weird path issue.

manuels commented 7 years ago

Can you check if there are any failed network requests?

zwaq commented 7 years ago

I did, and it does not try to get anything after getting the texlive.lst. I think it fails creating the fake/virtual unix filesystem, because I get the error multiple times and in the environment of the error, words like tmp, home, dev, proc etc are mentioned. And then it does not even proceed to download the texlive files. I disabled compression in the iis, but no luck. Can you upload an unminified version of the worker for easier debugging?

zwaq commented 7 years ago

The fix to #43 worked for me for chrome. In IE11, I still get

pdfTeX warning: /latex (file //texmf-dist/fonts/map/pdftex/updmap/pdftex.map): fontmap entry for `cob' already exists, duplicates ignored

A LOT of times.