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

Defining `css` in reveal-md.json throws exception on startup #229

Closed
rshev opened this Issue Jan 3, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@rshev
Copy link

rshev commented Jan 3, 2019

If I define css in reveal-md.json, reveal-md fails to start.

It seems that config initialisation calls parseOptions(local) which while parsing css assets calls getOptions which tries to access config which hasn't finished initialising yet. I'm not a js guy to fix it (shouldn't be hard to fix though).

❯❯❯ cat reveal-md.json
{
	"css": "PITCHME.css"
}
❯❯❯ env DEBUG=reveal-md reveal-md
  reveal-md localOptions { css: 'PITCHME.css' } +0ms
  reveal-md revealOptions { autoPlayMedia: null } +5ms
/usr/local/lib/node_modules/reveal-md/lib/options.js:100
  return _.defaults({}, config.args, config.local, config.defaults);
                        ^

ReferenceError: config is not defined
    at getOptions (/usr/local/lib/node_modules/reveal-md/lib/options.js:100:25)
    at getAssetPath (/usr/local/lib/node_modules/reveal-md/lib/options.js:37:42)
    at map.assetPath (/usr/local/lib/node_modules/reveal-md/lib/options.js:40:81)
    at Array.map (<anonymous>)
    at getAssetPaths (/usr/local/lib/node_modules/reveal-md/lib/options.js:40:64)
    at parseOptions (/usr/local/lib/node_modules/reveal-md/lib/options.js:144:24)
    at Object.<anonymous> (/usr/local/lib/node_modules/reveal-md/lib/options.js:84:10)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/reveal-md/lib/index.js:4:27)
    at Module._compile (internal/modules/cjs/loader.js:722:30)

@webpro webpro closed this in 9a4471c Jan 4, 2019

@webpro

This comment has been minimized.

Copy link
Owner

webpro commented Jan 4, 2019

Thanks @rshev! Should be fixed in v2.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment