Skip to content

ReferenceError: navigator is not defined using Markdown plugin API in node.js #3517

@MartenBE

Description

@MartenBE

When executing the following code in a node.js application:

import Reveal from 'reveal.js/dist/reveal.js';
import Markdown from 'reveal.js/plugin/markdown/markdown.js';
Reveal.initialize({ plugins: [Markdown, Highlight] });

We get the following error:

ReferenceError: navigator is not defined
    at /home/martijn/git/reveal-md/node_modules/reveal.js/dist/reveal.js:8:1705
    at /home/martijn/git/reveal-md/node_modules/reveal.js/dist/reveal.js:8:84
    at Object.<anonymous> (/home/martijn/git/reveal-md/node_modules/reveal.js/dist/reveal.js:8:201)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at cjsLoader (node:internal/modules/esm/translators:283:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:233:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:217:25)

We would like to call the slidify function from the Markdown plugin manually. How do we best go about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions