hakimel / reveal.js

The HTML Presentation Framework
https://revealjs.com
MIT License
67.66k stars 16.64k forks source link

Uncaught SyntaxError: missing ) after argument list @ notes.js:1:45020 with v5.1.0 #3659

Closed Lucas-C closed 3 weeks ago

Lucas-C commented 2 months ago

Hi 🙂

I just want to report an issue that I have when launching the latest release of reveal.js (5.1.0).

I'm using Firefox 127.0.2 but also reproduced the same issue with Chrome 126.0.6478.183

When launching the demo page, I get a blank white screen and this error in the console:

Uncaught SyntaxError: missing ) after argument list
[notes.js:1:45020](http://localhost:5500/plugin/notes/notes.js)
Uncaught ReferenceError: RevealNotes is not defined
    <anonymous> http://localhost:5500/index2.html:36

Capture d'écran 2024-07-21 115822

The interesting thing is that I tried to pinpoint the origin of this error by prettifying plugin/notes/notes.js using beautifier.io, and when putting the prettified code in plugin/notes/notes.js this error disappear, and Reveal.js launches properly!

MartenBE commented 4 weeks ago

I'm also experiencing this when using livereload. Exact same error.

hakimel commented 4 weeks ago

I tried running the demo.html presentation from 5.1.0 in both Chrome and Firefox but haven't been able to reproduce this yet. Also tried triggering a few livereloads. If you have any other info to share about when this error happens I'd appreciate it.

Lucas-C commented 4 weeks ago

This is really strange... The problem seems to come from this un-minified line: https://github.com/hakimel/reveal.js/blob/master/plugin/notes/plugin.js#L34

Specifically, based on my tests, the error disappear when removing the <head>...</head> portion of the speakerViewHTML. And even just having <head></head> is enough to trigger the error.

Lucas-C commented 4 weeks ago

I figured it out!

In my case, this was due to my use of Python livereload, that performs </head> tag replacement "on-the-fly": https://github.com/lepture/python-livereload/blob/master/livereload/server.py#L40

Lucas-C commented 4 weeks ago

I opened an issue & PR in https://github.com/lepture/python-livereload to report & fix this:

AFAIC this issue can be closed.

MartenBE commented 3 weeks ago

Python-livereload was the package I was using also, good catch @Lucas-C !

hakimel commented 3 weeks ago

Thank you for tracking this down @Lucas-C!

Let me know if any changes are needed to make this work on the reveal.js end.