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

Show better error message when there's no <div class="reveal"> #2217

Closed
LarryLuTW opened this issue Aug 16, 2018 · 2 comments
Closed

Show better error message when there's no <div class="reveal"> #2217

LarryLuTW opened this issue Aug 16, 2018 · 2 comments

Comments

@LarryLuTW
Copy link

When calling Reveal.initialize(); without <div class="reveal"> ... </div> in HTML, dev tool will show "Uncaught TypeError: Cannot read property 'classList' of null". But the error message doesn't point to the root cause.

In my opinion, the error message can be better, like Please provide a div element with class "reveal" in HTML. If you think this is a good idea, I can help to do this.

codepen: https://codepen.io/larrylu/pen/rrEaQq

HMarzban added a commit to HMarzban/reveal.js that referenced this issue Oct 24, 2018
@thomaswp
Copy link

This definitely wasted 30m of my life. Would appreciate this too.

@hakimel
Copy link
Owner

hakimel commented Aug 27, 2021

This has been addressed now. We'll now show more descriptive errors if either the .reveal root or .slides containers are missing. Thanks for the feedback!

@hakimel hakimel closed this as completed Aug 27, 2021
fab4100 pushed a commit to fab4100/reveal.js that referenced this issue Oct 1, 2021
fab4100 pushed a commit to fab4100/reveal.js that referenced this issue Oct 1, 2021
srwohl pushed a commit to srwohl/phantom-pres that referenced this issue Sep 2, 2024
srwohl pushed a commit to srwohl/phantom-pres that referenced this issue Sep 2, 2024
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

3 participants