webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.74k stars 416 forks source link

fail to load preprocessor #479

Closed dvirtz closed 6 months ago

dvirtz commented 7 months ago

After upgrading to v6.0.1 it fails to load the pre-processor:

> npx reveal-md --preprocessor preprocess.js .\slides\index.md
Serving reveal.js plugin from node_modules\reveal-md\node_modules\reveal.js
Serving reveal.js dist from node_modules\reveal-md\node_modules\reveal.js
Reveal-server started at http://localhost:1949
The slides are at http://localhost:1949/index.md
node:internal/errors:477
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'preprocess.js' imported from C:\Users\dyitzchaki\github\slides\node_modules\reveal-md\lib\config.js
    at new NodeError (node:internal/errors:387:5)
    at packageResolve (node:internal/modules/esm/resolve:909:9)
    at moduleResolve (node:internal/modules/esm/resolve:958:20)
    at defaultResolve (node:internal/modules/esm/resolve:1173:11)
    at nextResolve (node:internal/modules/esm/loader:173:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:852:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:439:18)
    at ESMLoader.import (node:internal/modules/esm/loader:536:22)
    at importModuleDynamically (node:internal/modules/esm/translators:110:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.6.0
webpro commented 6 months ago

You should use a relative path for local files e.g. --preprocessor ./preprocess.js

dvirtz commented 6 months ago

I try this from reveal-md.json but that results in

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '...\node_modules\reveal-md\lib\preprocess.js'