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

Error running javascript: TypeError: undefined is not a function #5

Open
indigoviolet opened this issue Mar 1, 2019 · 4 comments
Open

Comments

@indigoviolet
Copy link

I believe I have emacs with xwidgets support (I can do xwidget-webkit-browse-url, for instance), but this package only renders a blank white popup for me, and I see the following errors in terminal:

** (emacs:16002): WARNING **: 13:02:06.764: Error running javascript: TypeError: undefined is not a function

** (emacs:16002): WARNING **: 13:02:06.764: Error running javascript: undefined:1:39: TypeError: null is not an object (evaluating 'document.querySelector('.katex-html').offsetWidth')

** (emacs:16002): WARNING **: 13:02:06.764: Error running javascript: TypeError: undefined is not a function

Any pointers would be appreciated.

@fuxialexander
Copy link
Owner

Sorry for the late replay...It's apparently a JS problem but I'm afraid at the moment I have no idea where it lies...Could be Katex itself not been successfully imported.

You may try to evaluate the following code and see whether the situation changes

(defun webkit-katex-render--resize() nil)

If not, the problem is probably that Katex is not functioning/imported

@indigoviolet
Copy link
Author

Yeah, it doesn't seem to fix it. Can you give me any pointers as to where to look at the JS that should work? How can I investigate whether Katex is working?

@indigoviolet
Copy link
Author

Digging into the file a bit, I think it's the try_render function that is not being found -- when I change that to something else like document.body.innerHTML += %s, I see the effects in the webkit buffer.

@indigoviolet
Copy link
Author

Some more progress: I was setting --client-path incorrectly, so it wasn't finding the right katex.html. Once I fix that, and set --buffer-name to something else, like "webkit-katex" that I can actually inspect myself, I see that the Latex is being rendered in the webkit, but it still won't render in my org-mode buffer. I still see errors like

** (emacs:12687): WARNING **: 21:16:06.817: Error running javascript: undefined:1:39: TypeError: null is not an object (evaluating 'document.querySelector('.katex-html').offsetWidth')

** (emacs:12687): WARNING **: 21:16:06.831: Error running javascript: TypeError: undefined is not a function

** (emacs:12687): WARNING **: 21:16:06.848: Error running javascript: TypeError: null is not an object

** (emacs:12687): WARNING **: 21:16:06.848: Error running javascript: TypeError: null is not an object

Any ideas on how to dig further?

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

No branches or pull requests

2 participants